ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How can I create several instances of Excel ? (https://www.excelbanter.com/excel-programming/271998-how-can-i-create-several-instances-excel.html)

No Name

How can I create several instances of Excel ?
 
Hi,

How can I create several instances of Excel ? eventually 2-3 in one go ?

Usually, I do
Set oXL = WScript.CreateObject("Excel.Application")
followed by
oXL.Workbooks.Add
but, if the user has already Excel open, then my data is put in his current
workbook, no good

The should be something like oXL.Workbooks.Create but can't find it

Thanks
Raymond



Tom Ogilvy

How can I create several instances of Excel ?
 
According to help, CreateObject should do the job:

Use CreateObject when there is no current instance of the object. If an
instance of the object is already running, a new instance is started, and an
object of the specified type is created. To use the current instance, or to
start the application and have it load a file, use the GetObject function.

It is unclear why you would want more than one instance with the attendant
overhead.

Regards,
Tom Ogilvy
wrote in message
e...
Hi,

How can I create several instances of Excel ? eventually 2-3 in one go ?

Usually, I do
Set oXL = WScript.CreateObject("Excel.Application")
followed by
oXL.Workbooks.Add
but, if the user has already Excel open, then my data is put in his

current
workbook, no good

The should be something like oXL.Workbooks.Create but can't find it

Thanks
Raymond






All times are GMT +1. The time now is 05:43 PM.

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