break into an invisible instance of Excel

S

Smallweed

I've been running a scheduled task at night that involves opening an Excel
workbook and running some code. For some reason, although the task runs and
the code does its job, Excel is left hanging. It's invisible (unsurprisingly
as it was run by the scheduler) which means I can only see it listed in the
Processes tab of the Task Manager.

I've done some debugging using lines that write to a log file but haven't
managed to identify the problem. Does anyone know of a way to make a
reference to the hidden hanging instance of Excel so I can then have a look
at it?

(I've been looking at some API calls to find the window handler but can only
seem to return 0 or the handler of a new instance of Excel.)
 
H

HatesIT

probably have a dialog open from not setting DisplayAlerts to false

open notepad and put this line in it

GetObject(,"Excel.Application").Visible = True

save it as a .vbs file and run it
This will get the first instance of excel only so close any others...
hth
 
S

Smallweed

Thanks for those - very helpful

HatesIT said:
probably have a dialog open from not setting DisplayAlerts to false

open notepad and put this line in it

GetObject(,"Excel.Application").Visible = True

save it as a .vbs file and run it
This will get the first instance of excel only so close any others...
hth
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top