FLabrecque
Registered User.
- Local time
- Today, 12:33
- Joined
- Nov 9, 2004
- Messages
- 93
Thanks in advance for any help you can provide me with. As some of you may know (I've posted about this before), I export a lot of queries/table to Excel.
I saw in the sample database section, someone posting code about using an Excel object through VBA in MS-Access. Exactly what I need to make my life simpler! I want to offer basic formating for queries I output.
My problem is this: The following code works perfectly (I excluded the formating code, not to bore you with it). After it ran, if I try to open my XLS file while Access is still opened, a blank XLS window appears (I can not see the content, althought the title bar contains the name of my file). If I close Access, close Excel, and re-open my file, no problema! Is there a line of code I forgot?
Set xlsFile = CreateObject("Excel.Application")
xlsFile.Workbooks.Open strFile
xlsFile.ActiveWorkbook.Save 'Saves the spreadsheet
xlsFile.ActiveWorkbook.Close 'Closes Excel Spreadsheet
xlsFile.Quit 'Closes Excel
Set xlsFile = Nothing
I saw in the sample database section, someone posting code about using an Excel object through VBA in MS-Access. Exactly what I need to make my life simpler! I want to offer basic formating for queries I output.
My problem is this: The following code works perfectly (I excluded the formating code, not to bore you with it). After it ran, if I try to open my XLS file while Access is still opened, a blank XLS window appears (I can not see the content, althought the title bar contains the name of my file). If I close Access, close Excel, and re-open my file, no problema! Is there a line of code I forgot?
Set xlsFile = CreateObject("Excel.Application")
xlsFile.Workbooks.Open strFile
xlsFile.ActiveWorkbook.Save 'Saves the spreadsheet
xlsFile.ActiveWorkbook.Close 'Closes Excel Spreadsheet
xlsFile.Quit 'Closes Excel
Set xlsFile = Nothing