Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have inserted the code below in PERSONAL.XLS
This works if Excel is launched first, then I launch another template. However I get an error if I launch another template first, no matter what other template it is and whether it has code in it or not. I get a runtime error 91: Object variable or with block variable not set. Private Sub Workbook_Open() Call LaunchForecast End Sub Public Sub LaunchForecast() ' Dim strWorkBookname As String Dim oWorkb As Object Set oWorkb = Application.ActiveWorkbook strWorkBookname = oWorkb.Name DoEvents If Right(oWorkb.Name, 3) = "CSV" Then MsgBox "hold it" Application.ScreenUpdating = False Application.Workbooks.Add(Template:="\\Wmc-srv-2\Templates\PM Templates\dmsForecast.xlt").RunAutoMacros Which:=xlAutoOpen End If End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
xpath error? Runtime Error 13 type mismatch | Excel Discussion (Misc queries) | |||
error message - no clue what it is about | Excel Discussion (Misc queries) | |||
Runtime error '1004' General ODBC error | New Users to Excel | |||
Excel 2003 Macro Error - Runtime error 1004 | Excel Discussion (Misc queries) | |||
Syntax Error Runtime Error '424' Object Required | Excel Programming |