PDA

View Full Version : Workbook_Open Does Not Work



macro_man
04-22-2009, 08:48 AM
I have a few spreadsheets that have large macros that create high-level reports in a small window of time by people other than myself. It is imperative that the calculation be set to automatic before they are run to avoid errors (and follow-up questions to me). I inputted the following macro code and tested it. I set the calculation to manual (via Formulas=>Calculation Options), saved the file, then reopened it. The calculation stayed on the setting, Manual. ... :banghead:

Any idea why it won't execute when the file is opened? I have the Trust Center setting's radio-button on Enable all macros.

Private Sub Workbook_Open()

With Application
.Calculation = xlAutomatic
End With

End Sub

Bob Phillips
04-22-2009, 10:34 AM
Did you add that code to the ThisWorkbook code module?

DannyUk
04-22-2009, 10:35 AM
Hi macro_man,

Can you confirm that you place the code in "ThisWorkbook" module?

Danny