Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Opening New Excel Window

Status
Not open for further replies.

ErinP

Technical User
Nov 14, 2001
5
US
I posted this question before but thought I would try again with what I have found out. I am trying to open a brand new excel window when a certain spreadsheet is opened in Excel 97(so there is 2 instances when the user has one already opened, etc.). Someone recommended that I use the "CreateObject" and "GetObject" functions. In theory, upon reading the descriptions they should work. I put the coding into my spreadsheet and it doesn't. There is a note at the end of the description of "CreateObject" that says:
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.

If an object has registered itself as a single-instance object, only one instance of the object is created, no matter how many times CreateObject is executed.

How would I know if Excel has registered itself as a single-instance object? Is there anything that I can do to change that? I am getting really frustrated at this point. Any help would be greatly appreciated.

ErinP
 
Try this. It would replace the GetObject method you are using.
Code:
Dim xlApp as Excel.Application

Set xlApp = New Excel.Application
xlApp.Visible = True
[code]
 
No go. It still opens the file in the existing session of Excel. Could it have something to do with my program?

ErinP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top