View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
AB[_2_] AB[_2_] is offline
external usenet poster
 
Posts: 236
Default open workbook in new window using VBA

Or, perhaps more importantly, - why do you need 2 intances of Excel
running? Can't you have the test.xls openned in the same instance of
Excel you're already running?
Then your code would work.



On Mar 7, 1:31*pm, ganesh25 wrote:
Hi, I have macro which opens workbbok in new window but I am getting
the same window as activated. But I want original workbbok should be
activated.
Please help me?
Please find below code for the reference.
Sub test()
* * Dim MWBK As Workbook
* * Set MWBK = ActiveWorkbook
* * Dim exlApp As Excel.Application
* * Set exlApp = New Excel.Application
* * exlApp.Visible = True
* * exlApp.Workbooks.Open "D:\Documents and Settings\n404591\Desktop
\test.xls"
* * MWBK.Activate
End Sub

Thanks,
Ganesh K.