How do I query to see if Excel is already running?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Lisa Z
    New Member
    • Aug 2007
    • 2

    How do I query to see if Excel is already running?

    I have an application that opens and Excel workbook, does some manipulations, prints the workbook to a printer and then deletes the file. It has problems deleting this file when another Excel session is already open. I don't want to do anything fancy but query to determine if EXCEL.EXE is running before I start my logic and if so, just give the user a message that they need to save their current Excel workbook and exit Excel prior to continuing.

    What is the VB6.0 code that I use to see if Excel.exe is currently running?
  • Denburt
    Recognized Expert Top Contributor
    • Mar 2007
    • 1356

    #2
    Hello Lisa, I responded to your question somewhat in the other thread just today did I slow down enough to realize that you did post here first and have waited a fair piece. For that I am sorry, some areas can use some better monitoring but like me most of us here are all volunteers.

    Did my post help answer your question or are you still hiving an issue as I stated in the other post you should be able to call Excell using:

    Set xlApp = GetObject(, "Excel.Applicat ion")

    I don't know the exact error number but if excel is not running it will error out and you can run your routine.

    Comment

    Working...