View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
ganesh25 ganesh25 is offline
external usenet poster
 
Posts: 1
Default open workbook in new window using VBA

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.