ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   break into an invisible instance of Excel (https://www.excelbanter.com/excel-programming/405660-break-into-invisible-instance-excel.html)

Smallweed

break into an invisible instance of Excel
 
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.)

HatesIT

break into an invisible instance of Excel
 
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

"Smallweed" wrote:

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.)


Smallweed

break into an invisible instance of Excel
 
Thanks for those - very helpful

"HatesIT" wrote:

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

"Smallweed" wrote:

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.)



All times are GMT +1. The time now is 09:54 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com