Why is my Workbook Open procedure not working

R

Ron McCormick

I have put a workbook open procedure in my model on the 'This Workbook' sheet.

Public Sub WorkBook_Open()

AnalysisToolPak_Exists 'Procedure to ensure Analysis toolpak is operational
'Maximize worksheet to calculate dimensions
Application.WindowState = xlMaximized
Application.ScreenUpdating = False
TaskBar_Hide 'Procedure to hide taskbar
Application.DisplayFullScreen = True
With Application
.Calculation = xlAutomatic
.Iteration = True
.MaxIterations = 50
.MaxChange = 0.001
End With
Application.ScreenUpdating = True
ActiveWorkbook.PrecisionAsDisplayed = False
Health_warningfrm.Show 'Calls "Splash" screen to warn users of model limitations

Load Mainscreen
Mainscreen.Show

End Sub

My problem is that it will not run when the workbook is opening. It can be run from within Excel via Tools Macro Run. It did run at an earlier stage in the devlopment process of the model. Latterly it ran occasionally, but now it seems it never works.

I am running Excel 2002, though it was originally developed in Excel 2000.

Anyone any ideas as to what maybe wrong.
 
F

Frank Kabel

Hi
some ideas:
- check that you really have put this code in your
workbook module
- check if application events are enabled. e.g. enter the
following line in the immediate Window:
applicationenableevents=true
and try again
-----Original Message-----
I have put a workbook open procedure in my model on the 'This Workbook' sheet.

Public Sub WorkBook_Open()

AnalysisToolPak_Exists 'Procedure to ensure Analysis toolpak is operational
'Maximize worksheet to calculate dimensions
Application.WindowState = xlMaximized
Application.ScreenUpdating = False
TaskBar_Hide 'Procedure to hide taskbar
Application.DisplayFullScreen = True
With Application
.Calculation = xlAutomatic
.Iteration = True
.MaxIterations = 50
.MaxChange = 0.001
End With
Application.ScreenUpdating = True
ActiveWorkbook.PrecisionAsDisplayed = False
Health_warningfrm.Show 'Calls "Splash" screen to
warn users of model limitations
Load Mainscreen
Mainscreen.Show

End Sub

My problem is that it will not run when the workbook is
opening. It can be run from within Excel via Tools Macro
Run. It did run at an earlier stage in the devlopment
process of the model. Latterly it ran occasionally, but
now it seems it never works.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top