Hi all
Got a weird scenario here and I have no idea of how to solve it.
Here is what I am doing.
In Access, I am creating various reports for a number of people which is done once a month.
My logic flow is as follows:
Create Excel.Application Object
Retrieve name of first person and report data
Loop begins
Open Excel template for the report
Fill in the template with the data
Save (as a new file), close and email the report
Retrieve the name of next person and the
relevant data
Loop ends
Excel.Application.Quit
Set Excel Object = nothing
This all works perfectly fine and dandy under Windows 2000, but when I run it on a Windows 95 or Windows 98 machine, the Excel object is not destroyed is I create more than a certain number of reports (about 30 to 45) and it utilised about 95%+ of the CPU usage.
I have even moved the creation and destruction of the Excel object into the loop and that creates even more havoc on all the operating systems.
It seams as if Windows’ parrallel processing and/or caching gets in the way and it tries open an Excel spreadsheet using the Excel Object when the object hasn’t been created yet, or even destroy the object when the object hasn’t finished doing some internal processing (and therefore unable to destroy it).
Anyone got any ideas on how to solve this?
Thanks in advance!
James