Name Stamp export to Excel

  • Thread starter Thread starter learning_codes
  • Start date Start date
L

learning_codes

Hi,

Is there a way to make the data export to excel like "Bob.xls". Right
now, I try to test and still give me the name of the query.

Here is the line of the code:

DoCmd.SendObject acQuery, "Query", "MicrosoftExcelBiff8 *.xls)",
"(e-mail address removed)", "", "", "Subject", "", False

I received my email with attachment: Query.xls

Is there a way for me to capture from CurrentUserName (strUserID =
Me.CurrentUserName)?

I want to see Bob.xls instead of Query.xls.

Your help would be much appreciated.

Thanks
 
Use DoCmd.TransferSpreadsheet instead of DoCmd.SendObject. You can specify
the name of the EXCEL file with DoCmd.TransferSpreadsheet.
 
Back
Top