automated send excel file with ability to change file name

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.
 
G

Guest

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.
 
G

Guest

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top