automated send excel file with ability to change file name

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I have 2 questions:

1) I generate an excel spreadsheet from an access report on a daily basis.
I would like to semi automate this with the send command macro. However,
this does not allow me to rename the excel file as it automatically gives it
the report name. I would like the title of the file to b the report name and
current date (i.e. daily report 04-27-07). Can this be done? If so, how?

2) sometimes when I use the send command in a macro, the email comes up and
wont send when you click the button. The send button appears to click but
the email does nothing. Any idea why?

Thanks in advance for your help.
 
Use the following code for #1

DoCmd.OutputTo acOutputQuery, "querytosave", acFormatXLS,
"pathname\dailyreport" & Format(Date, "yyyy-mm-dd") & ".xls"

I am sorry, but I do not know much about Outlook to answer #2.

Please let me know if I can provide more assistance.
 
Where do I use the code? In the macro?

hmadyson said:
Use the following code for #1

DoCmd.OutputTo acOutputQuery, "querytosave", acFormatXLS,
"pathname\dailyreport" & Format(Date, "yyyy-mm-dd") & ".xls"

I am sorry, but I do not know much about Outlook to answer #2.

Please let me know if I can provide more assistance.
 
Back
Top