VB Email - Laufz.Fehler 429 - Office 2010
25.09.2015 13:58:30
Thorben
ich habe einen komischen Fehler und krieg den nicht ausgemerzt.
8 PC's unterschiedlichster Hardware
8x Win 7
8x Office 2010
7x PC ohne Probleme
1x PC der den Laufzeitfehler 429 meldet:
Mein Code:
Sub Emailer()
Dim strMail As String
Dim strCC As String
Dim strBetreff As String
Dim strText As String
Dim strAttach1 As String
Dim strAttach2 As String
Dim strAttach3 As String
Dim iZeile As Long
strMail = "hallo@hallo.com"
strCC = ""
strBetreff = "Hallo"
strText = "Hallo" & vbCrLf & vbCrLf & "\\ein entsprechender DNC Pfad\""
strAttach1 = ""
strAttach2 = ""
strAttach3 = ""
Call SendeMail(strMail, strCC, strBetreff, strText, strAttach1, strAttach2, strAttach3)
End Sub
Public Function SendeMail(strMail As String, strCC As String, _
strBetreff As String, strText As String, _
Optional strAttach1 As String, Optional strAttach2 As String, _
Optional strAttach3 As String)
Dim oApp As Object
Set oApp = CreateObject("Outlook.Application")
On Error Resume Next
With oApp.CreateItem(0)
.To = strMail
.CC = strCC
.Subject = strBetreff
.Body = strText
.Attachments.Add strAttach1
.Attachments.Add strAttach2
.Attachments.Add strAttach3
.Display
.send
End With
On Error GoTo 0
Set oApp = Nothing
ActiveWorkbook.Save
MsgBox ("Fertig")
End Function
Besten Dank schon mal für jegliche Hilfe.
Gruß
Thorben