Multiple Excel Sessions

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

spacefamily

Thread Starter
Joined
Dec 12, 2011
Messages
1
How do I open multiple excel sessions? Opening multiple windows within one excel session/window is not productive in working/comparing multiple spreadsheets.
 

Keebellah

Hans
Trusted Advisor
Joined
Mar 27, 2008
Messages
6,639
Hi, welcome to the forum.

I tried a batch file but it uses the same Excel session
I tried the vbs script below and it does the job:

Code:
Public GetAbsolutePath, GetTheParent
Dim objExcel, f, objFso, fname
Set objFso = CreateObject("Scripting.FileSystemObject") 
Set objExcel = CreateObject("Excel.Application")
GetAbsolutePath = objfso.GetAbsolutePathName(Wscript.ScriptName)
GetTheParent = Objfso.GetParentFolderName(WScript.ScriptFullName) 'Returns the parentfolder of the Path/File specified

fname = Array("[COLOR="Red"]<filename here incl extension>[/COLOR]","[COLOR="Red"]<filename here incl extension>[/COLOR]")
For f = LBound(fname) To UBound(fname)
	If objFso.FileExists(GetTheParent & "\" & fname(f)) Then
		MsgBox fname(f),,f
		objExcel.Workbooks.Open(GetTheParent & "\" &fname(f))
		objExcel.Visible = True
	End If
Next 
Set objExcel=Nothing
Set objFso=Nothing 
WScript.quit
Copy the code to Notepad and choose save as and type the name in between quotes "<the name you give it>.vbs" so that the .txt extension won't be used.
Place this one in the saem folder as you Execl files.

If the files are in different folders then you will have to include the fullpaath instead of GetTheParent

This will open all the Execl files in a new Excel session

I hope I've been able to explain it a bit.
 

Keebellah

Hans
Trusted Advisor
Joined
Mar 27, 2008
Messages
6,639
Nice one, but then it will do it all the time.

BTW, Office 2010 is Office14 so then you have them all :)
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Members online

Top