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.
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
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!