M
mburkett
I am getting a 'General Mail Failure' at the following line. It is
supposed to email the active file. The funny thing is it works 100% on
3 of the 4 comptuters at work and 75% of the time on the 4th. Sometimes
a reboot will get in back running properly on the 4th computer, other
times not. I can not seem to narrow down any significant difference in
the computers. Any idea where to start looking?
Code the error occurs:
Application.Dialogs(xlDialogSendMail).Show
Arg1:="(e-mail address removed)", Arg2:="E-Mail Order for Account " +
acctname2
Here is the whole macro:
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Sheets("Trade Sheet").Select
Range("p3").Select
acctname = Selection.Value
Range("g2").Select
acctname2 = Selection.Value
Columns("A:G").Select
Selection.Copy
Workbooks.Open Filename:="C:\MODEL\Trading\blk trd ticket.xls"
Range("a1").Select
ActiveSheet.Paste
Windows("STOCKS.xls").Activate
Range("G4").Select
Selection.Copy
Windows("blk trd ticket.xls").Activate
Range("G4").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Cells.Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Range("A7:G108").Select
Range("G7").Activate
Application.CutCopyMode = False
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="<>"
Selection.Sort Key1:=Range("A8"), Order1:=xlDescending,
Key2:=Range("B8") _
, Order2:=xlAscending, Header:=xlYes, OrderCustom:=1,
MatchCase:=False _
, Orientation:=xlTopToBottom
ActiveWorkbook.SaveAs Filename:="F:\MODEL\Trading\Email Tickets\" +
acctname + ".xls", FileFormat _
:=xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:= _
False, CreateBackup:=False
Range("a1").Activate
Application.Dialogs(xlDialogSendMail).Show
Arg1:="(e-mail address removed)", Arg2:="E-Mail Order for Account " +
acctname2
Workbooks(acctname + ".xls").Close SaveChanges:=False
Windows("STOCKS.xls").Activate
ActiveSheet.AutoFilterMode = False
Thank you for any help you can provide.
supposed to email the active file. The funny thing is it works 100% on
3 of the 4 comptuters at work and 75% of the time on the 4th. Sometimes
a reboot will get in back running properly on the 4th computer, other
times not. I can not seem to narrow down any significant difference in
the computers. Any idea where to start looking?
Code the error occurs:
Application.Dialogs(xlDialogSendMail).Show
Arg1:="(e-mail address removed)", Arg2:="E-Mail Order for Account " +
acctname2
Here is the whole macro:
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Sheets("Trade Sheet").Select
Range("p3").Select
acctname = Selection.Value
Range("g2").Select
acctname2 = Selection.Value
Columns("A:G").Select
Selection.Copy
Workbooks.Open Filename:="C:\MODEL\Trading\blk trd ticket.xls"
Range("a1").Select
ActiveSheet.Paste
Windows("STOCKS.xls").Activate
Range("G4").Select
Selection.Copy
Windows("blk trd ticket.xls").Activate
Range("G4").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Cells.Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Range("A7:G108").Select
Range("G7").Activate
Application.CutCopyMode = False
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="<>"
Selection.Sort Key1:=Range("A8"), Order1:=xlDescending,
Key2:=Range("B8") _
, Order2:=xlAscending, Header:=xlYes, OrderCustom:=1,
MatchCase:=False _
, Orientation:=xlTopToBottom
ActiveWorkbook.SaveAs Filename:="F:\MODEL\Trading\Email Tickets\" +
acctname + ".xls", FileFormat _
:=xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:= _
False, CreateBackup:=False
Range("a1").Activate
Application.Dialogs(xlDialogSendMail).Show
Arg1:="(e-mail address removed)", Arg2:="E-Mail Order for Account " +
acctname2
Workbooks(acctname + ".xls").Close SaveChanges:=False
Windows("STOCKS.xls").Activate
ActiveSheet.AutoFilterMode = False
Thank you for any help you can provide.