I am trying to find a way so that when ever a user opens a particular workbook it always opens in a new window.
I have a user form attached to this workbook.
I tried using this code and inserted into the workbook Open event.
Sub OpenNewInstance()
Dim appXL As New Excel.Application
appXL.Workbooks.Open "D:DataSlamson.xls"
appXL.Visible = True
End Sub
good news and bad news.. first it does open a new window.. bad news it keeps wanting to open a new instance non stop.. and kicks out a waiting for OLE error.. So where am I suppose to put this code? here is the full code... if I'm not suppose to put it in the workbook_Open event then where?..
Private Sub Workbook_Open()
Dim appXL As New Excel.Application
appXL.Workbooks.Open "D:"""""'.xls"
appXL.Visible = True
Application.ScreenUpdating = False
With Application
.WindowState = xlNormal
.Width = 800
.Height = 200
End With
ATPLOG.Show
Application.ScreenUpdating = True
End Sub
Bookmarks