M
Marshall
Hi,
I've made a PJ user form to allow an excel report of
timescaled date for specified resource groups. After
choosing the groups to include, a click event opens
Excel, adds a new workbook, and writes out to it.
The problem is what next...
If I close the instance of Excel (2000) from PJ (2002
prof) and release the object (set appxl = nothing), I
find that the XP Task Manager shows that the Excel app
(as viewed in the Task Manager 'Applications' tab) has
been closed, but the associated process (excel.exe - in
the 'Processes' tab) is still running. This results in
object errors (runtime 1004 method Range of object
_Application failed) if the same PJ code is run a second
time (despite working perfectly - apart from not
releasing the process! - the first time).
Killing the process manually from the Task Manager allows
the code to run through a second time with no probs.
Hitting the STOP button on the vb debugger also releases
the process (even if the form has already been unloaded
and the code has finished running - weird). But I
obviously don't want users to have to do either of
these...
I would actually prefer to be able to leave the created
Excel sheet and/or the Excel app itself open and run the
code from the click event again, but this too produces
object errors
Any ideas on what I'm doing wrong?
I've made a PJ user form to allow an excel report of
timescaled date for specified resource groups. After
choosing the groups to include, a click event opens
Excel, adds a new workbook, and writes out to it.
The problem is what next...
If I close the instance of Excel (2000) from PJ (2002
prof) and release the object (set appxl = nothing), I
find that the XP Task Manager shows that the Excel app
(as viewed in the Task Manager 'Applications' tab) has
been closed, but the associated process (excel.exe - in
the 'Processes' tab) is still running. This results in
object errors (runtime 1004 method Range of object
_Application failed) if the same PJ code is run a second
time (despite working perfectly - apart from not
releasing the process! - the first time).
Killing the process manually from the Task Manager allows
the code to run through a second time with no probs.
Hitting the STOP button on the vb debugger also releases
the process (even if the form has already been unloaded
and the code has finished running - weird). But I
obviously don't want users to have to do either of
these...
I would actually prefer to be able to leave the created
Excel sheet and/or the Excel app itself open and run the
code from the click event again, but this too produces
object errors
Any ideas on what I'm doing wrong?