By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,106 Members | 2,474 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,106 IT Pros & Developers. It's quick & easy.

File name automatically changing in error when exporting from Access to Excel

P: 1
Hello! I am receiving an error when exporting from Access to Excel. The query name is automatically being changed from the Access query name written in the docommand code to a string of letters and numbers in the file save location. The file won't save in Excel due to this. Any assistance is greatly appreciated!
Feb 8 '19 #1
Share this Question
Share on Google+
2 Replies

Expert 100+
P: 1,035
And how does your 'DoCmd' look like?

Or, otherwayz formulated:
This will always product a file named d:\temp\tabel1.xlsx, unless it already exists:
Expand|Select|Wrap|Line Numbers
  1. Function Macro1()
  2. On Error GoTo Macro1_Err
  3.     DoCmd.OutputTo acOutputTable, "Tabel1", "ExcelWorkbook(*.xlsx)", "d:\temp\tabel1.xlsx", False, "", , acExportQualityPrint
  5. Macro1_Exit:
  6.     Exit Function
  8. Macro1_Err:
  9.     MsgBox Error$
  10.     Resume Macro1_Exit
  12. End Function
Feb 9 '19 #2

Expert Mod 2.5K+
P: 3,284

Welcome to Bytes!

Yes, please post the code you are using and we can try to troubleshoot with yo.
Feb 10 '19 #3

Post your reply

Sign in to post your reply or Sign up for a free account.