O
ozhunter
I have some VBL code that copies a specific worksheet from a workbook then
emails it. Is it possible to alter the code to answer an Outlook Express
message box that asks if I want to send the message
This the code that works well, except for the box that comes up
Kill "C:\Documents and Settings\Compaq_Administrator\My Documents\Pay
Slips\Book2.xls"
Sheets("Pay Slip").Visible = True
Sheets("Pay Slip").Select
Sheets("Pay Slip").Copy
Range("A1:G17").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("a1").Select
ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\Compaq_Administrator\My Documents\Pay
Slips\Book2.xls", _
FileFormat:=xlExcel8, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
ActiveWorkbook.SendMail Recipients:="(e-mail address removed)", Subject:="Hi"
ActiveWorkbook.Close SaveChanges:=False
Sheets("Pay Slip").Select
Sheets("Pay Slip").Visible = False
emails it. Is it possible to alter the code to answer an Outlook Express
message box that asks if I want to send the message
This the code that works well, except for the box that comes up
Kill "C:\Documents and Settings\Compaq_Administrator\My Documents\Pay
Slips\Book2.xls"
Sheets("Pay Slip").Visible = True
Sheets("Pay Slip").Select
Sheets("Pay Slip").Copy
Range("A1:G17").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("a1").Select
ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\Compaq_Administrator\My Documents\Pay
Slips\Book2.xls", _
FileFormat:=xlExcel8, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
ActiveWorkbook.SendMail Recipients:="(e-mail address removed)", Subject:="Hi"
ActiveWorkbook.Close SaveChanges:=False
Sheets("Pay Slip").Select
Sheets("Pay Slip").Visible = False