View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ron Dahl[_2_] Ron Dahl[_2_] is offline
external usenet poster
 
Posts: 18
Default Activate Workbook in Separate Excel Session

If I understood the question correctly, I have used the following code to
force open a new instance of Excel.
Ron Dahl

Sub OpenFileInNewInstanceOfExcel()
Dim TheName As String
Dim oXL As Object
On Error Resume Next ' Defer error trapping.
ChDir CurDir
TheName = Application.GetOpenFilename( _
filefilter:="Excel Files (*.xls), *.xls", _
Title:="Load Excel File")
Set oXL = CreateObject("Excel.application")
oXL.Workbooks.Open TheName
oXL.Application.Visible = True
oXL.ActiveWorkbook.RunAutoMacros xlAutoOpen
End Sub




"Bill Manville" wrote in message
...
Bob Ewers wrote:
Is it possible to activate this workbook without opening it in the

current session of Excel.

Simple answer: no.

More complicated answer: maybe - if you used API calls to find other

instances of Excel and
then use Automation to see if any of them have Test1.xls open. I don't

have details of any
suitable API calls with me.

Bill Manville
MVP - Microsoft Excel, Oxford, England
No email replies please - reply in newsgroup