Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automate Excel sheet to create attachment. 2

Status
Not open for further replies.

kphu

MIS
May 30, 2002
346
US
Greetings All...

I have a weekly sales report that I create for each sales rep and email each individual report. The amt of time spent sending each email is getting to be a nuisance.

I've been working on automating my excel sheet so that it creates an email of itself as an attachment. The problem that I'm having is that when it creates the email itself it creates a name of True.xls instead of the name that I saved it as. Was wondering if anyone knows how to keep it as its current name.

This is my basic code so far.

ActiveWorkbook.SaveAs Application.Dialogs(xlDialogSaveAs).Show
Activeworkbook.sendmail Application.Dialogs(xlDialogSendMail).Show


Any help would be greatly appreciated.

Thanks,

Ken

 
yes, I save the file before the send mail dialog.
 
I create a new file.

I save the file with the following code.

ActiveWorkbook.SaveAs Application.Dialogs(xlDialogSaveAs).Show

The dialog comes up and it saves the file with the new name and location\path that I set it as.

Then the next statement.

Activeworkbook.sendmail Application.Dialogs(xlDialogSendMail).Show

executes and composes an email with the file attached.
The problem is that the name of the file is now True.xls instead of the name I gave it.
 
Thanks skip, I appreciate your help. Can't believe it was something as simple as that. You earned your star today.
 
Good info...for that you get a star.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top