Hi all,
Please note, this question has been asked here:
https://bit.ly/2Tv0zCv
I am exporting a query via DoCmd.ExportSpreadsheet to Excel. After I export this workbook, I must open it and edit some things in code. See below for snippet of code:
Code:
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12Xml, qdf.Name, PathandFilename, True
MsgBox PathandFilename
Set wBook = appExcel.Workbooks.Open(PathandFilename)
The variable pathandfilename is a path which is obtained by the msofiledialogpicker object. When the code trys to set the wBook object, Access hangs and Excel prompts me with an error message saying:
"Sorry we couldnt find {the path}. Is it possible it was move, changed or deleted?"
Now, the most interesting component to this problem is that when I "replace" an existing file with the filepicker, the code runs fine. It is when I create a new file name in the picker where excel cannot find the file after.
Hoping there is some help!
Thanks for your time.