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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I open a new window everytime with Excel VBA?

Status
Not open for further replies.

ErinP

Technical User
Nov 14, 2001
5
0
0
US
I'm fed up with trying to figure this out on my own so decided I should go to the experts for help. I am trying to find a way that when a specific Excel file is opened (by double clicking on it) that it will open up in a brand new Excel window (i.e. if I have a different spreadsheet open and try to open this specific file that I will end up with 2 sessions of Excel open). I am using Excel 97 (work is a little behind the times). Someone please help!

ErinP
 
See if this what you are after. Goto Tools>Options on the menu. On the View tab, select <Windows on Taskbar>. Jon Hawkins
 
that wont work, its an excel 2000 feature, erin has 97.

look at this stuff (its straight from the help file),
......
Visual Basic can create new objects and retrieve existing objects from many Microsoft applications. Other applications may also provide objects that you can create using Visual Basic. See the application's documentation for more information.
To create an new object or get an existing object from another application, use the CreateObject function or GetObject function:

' Start Microsoft Excel and create a new Worksheet object.
Set ExcelWorksheet = CreateObject(&quot;Excel.Sheet&quot;)

' Start Microsoft Excel and open an existing Worksheet object.
Set ExcelWorksheet = GetObject(&quot;SHEET1.XLS&quot;)
......

and then lookup the create object function doco,, I think that'll put you on the right track...

hope this helps,

k.
 
The &quot;Create Object&quot; and &quot;Get Object&quot; are not working the way I want it to. Perhaps there is another way around this. There are some spreadsheets that I use at work that will keep some kind of memory in MS Visual Basic even after it is closed. These other VBAProjects are what is causing the runtime errors in my spreadsheet. Is there a way to get rid of these other VBAProjects before any of my scripts are run?
 
Set Application.IgnoreRemoteRequests = True, and any future attempt to launch Excel from clicking on a file will create a new instance of Excel.

AC
 
That didn't work either. Am I supposed to be putting this script in a certain place? Should I force my company to get Excel 2000 and forget about it? I am about ready to throw my computer out the window!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top