Link to home
Start Free TrialLog in
Avatar of Ian Wallace
Ian Wallace

asked on

Writing data from Access to Excel produces a blank document

Hi,

I have a reporting package which is written in MS Access.

Some of the reports need to be produced in Excel, so the Access database grabs the data it needs from SQL and then write the Excel document (They are all a bit quirky and have to be formatted a certain way so a DoCmd.OutPutTo won't work).

Some users are having issues where the document is created, the headers are there, the column headers are there, the page formatting has been done, but theres no data!  Some of them can close the Access database, reopen it and then it will work, but others haven't been able to create these reports for weeks.

I've made sure they are all on the same versions of Windows and Office so am now stuck.

Any help would be appreciated!
Avatar of Dale Fye
Dale Fye
Flag of United States of America image

Using automation to open and manipulate Excel can be a challenge.
Can you provide the code you are using to write to the Excel file?
Just as importantly, when you finish writing to Excel, you need to make sure that you have cleared out all of the objects you may have created (ranges, sheets, workbooks, Excel) during your process.  Failure to do so will generally result in rogue instances of Excel being open but only visible in the task manager.

ASKER CERTIFIED SOLUTION
Avatar of byundt
byundt
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial