M
Martin
I am trying to use SendMail with an array and I
intermittently get the '1004' General mail failure error.
Note that this is intermittent. The macro WILL work. But
the moment I make any alteration to the macro, the
SendMail will fail.
However, there doesn't seem to be any rhyme or reason to
the error. I will try various things, such as remarking
out
the input box statement or the sendmail and eventually
when I put them back in everything works. And will work
over and over. But as soon as I make ANY change to the
macro, even cosmetic (such as adding a remarked
statement), the error returns. I am running WXP SP2 with
Outlook 2003 as my mail client and Excel 2003. It seems
as if the sendmail statement is keeping a process hung up
somewhere. However, neither shutting down nor rebooting
seems to have any effect. I am copying the last part of
the macro below in case it helps. As you can see, this is
the section that prompts the user for an address and then
sends mail to that address as well as the static address.
I know this is difficult since it's not exactly
reproduceable, but any help that could be given would be
great because the code (when it works) does EXACTLY what
I need.
Thanks!
' Get SLM address
Dim Message, Title, Default
Message = "Enter your email address: "
Title = "To receive a copy..."
Dim Add(2) As String
Add(1) = "(e-mail address removed)"
Add(2) = InputBox(Message, Title)
ActiveWorkbook.SendMail Recipients:=Add(),
Subject:="SW/Equip. Order for Cust: " & CustNum.Value
& " - " & OrdDate.Value
ActiveWindow.Close
Kill sPath & "SWE Order for Customer " & CustNum.Value
& ".xls"
Application.ScreenUpdating = True
Application.Quit
End Sub
intermittently get the '1004' General mail failure error.
Note that this is intermittent. The macro WILL work. But
the moment I make any alteration to the macro, the
SendMail will fail.
However, there doesn't seem to be any rhyme or reason to
the error. I will try various things, such as remarking
out
the input box statement or the sendmail and eventually
when I put them back in everything works. And will work
over and over. But as soon as I make ANY change to the
macro, even cosmetic (such as adding a remarked
statement), the error returns. I am running WXP SP2 with
Outlook 2003 as my mail client and Excel 2003. It seems
as if the sendmail statement is keeping a process hung up
somewhere. However, neither shutting down nor rebooting
seems to have any effect. I am copying the last part of
the macro below in case it helps. As you can see, this is
the section that prompts the user for an address and then
sends mail to that address as well as the static address.
I know this is difficult since it's not exactly
reproduceable, but any help that could be given would be
great because the code (when it works) does EXACTLY what
I need.
Thanks!
' Get SLM address
Dim Message, Title, Default
Message = "Enter your email address: "
Title = "To receive a copy..."
Dim Add(2) As String
Add(1) = "(e-mail address removed)"
Add(2) = InputBox(Message, Title)
ActiveWorkbook.SendMail Recipients:=Add(),
Subject:="SW/Equip. Order for Cust: " & CustNum.Value
& " - " & OrdDate.Value
ActiveWindow.Close
Kill sPath & "SWE Order for Customer " & CustNum.Value
& ".xls"
Application.ScreenUpdating = True
Application.Quit
End Sub