I'm using Auto_Open on a Excel Template (.xlt) to run a macro which imports some data to a sperate sheet, adds some forula and then creates a number of pivot tables and charts. The result of which is a finalised report which can then be saved as .xls.
I have added the following IF statement to the top of the Auto_Open sub to check cell A2 if it contains "Service Activity Report" (this is a merged cell from A2:N2) and if it does to Exit the Macro. This is so the Macro will not run for second time after the report has been generated.
If ActiveSheet.Range("A2").Text = "Service Activity Report" Then
Exit Sub
Else
Two Questions:
Is this the best way to stop the macro running for a second time and overwriting the finalised report?
The Macro only works in Excel 2007 due to the nature of the charts yet the code above is being skipped over in Excel 2003
Any ideas?