Skip to: Site menu | Main content

Login

Name: 
Password:
Remember me?
Register

Finding Hidden Office Application Instances

written by Mark Rowlinson - Last updated Oct 2004

The following piece of code is very useful for anyone who's ever spent time creating appliactions that automate Office. Often the Office application has it's visible property set to false while it is ued in the background. While developing and testing applications if a RTE should occur you may be left with an instance of the application still running in the background

Place the code in a text file and rename it "ShowExcel.vbs". The vbs extension indicating the file is a vbscript file. Double click the file and if there is a hidden excel instance it will appear.

 
On Error Resume Next 
Set oApp=GetObject(,"Excel.application") 
oApp.visible=True 
 

The code will work equally well with any other office application. Simply replace "Excel.application" with "Word.application" for example to find hidden word instances.