Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Check for instance of EXCEL running
I'm trying to test for an existing instance of Excel already running.
In my VB6 code I do the following: Dim oExcel As Object Set oExcel = CreateObject("Excel.Application") If Excel were already running I would do this: Set oExcel = GetObject(, "Excel.Application") How can I test to see if Excel is already running? I've found some examples but they were a bit convoluted. Thanks for any help. Kevin |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Check for instance of EXCEL running
Hi Kevin
Don't overcomplicate this. Just use GetObject. If it errs then excel's not running and so you create one: Dim oExcel As Object On Error Resume Next Set oExcel = GetObject(, "Excel.Application") If oExcel Is Nothing Then Set oExcel = CreateObject("Excel.Application") End If HTH. Best wishes Harald "Kevin" skrev i melding ... I'm trying to test for an existing instance of Excel already running. In my VB6 code I do the following: Dim oExcel As Object Set oExcel = CreateObject("Excel.Application") If Excel were already running I would do this: Set oExcel = GetObject(, "Excel.Application") How can I test to see if Excel is already running? I've found some examples but they were a bit convoluted. Thanks for any help. Kevin |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
my excel settings changed and i have only 1 instance running. | Setting up and Configuration of Excel | |||
Running Two Instance of Excel 2003 Simultaneously - Advice Please | Excel Discussion (Misc queries) | |||
How to determine if instance of Excel is running | Excel Programming | |||
Check for Excel version before running? | Excel Programming | |||
opening and running macros in an Excel file in a new instance of Excel | Excel Programming |