I have a worksheet with the name "Dates" (the name of the object is A_Dates) that needs to be calculated when it is activated (maybe it’s worth noting that this is in my Personal Macro Book). I regularly open workbooks that have too many calculations for me to have auto-calculation. Therefore, I have automatic calculation in manual mode and the following code on the sheet:
Private Sub Worksheet_Activate() A_Dates.Calculate End Sub
This has worked great the past 3 months, day after day. Yesterday he stopped working. Now it throws this error in the declaration line:
Microsoft Visual Basic Automation error Unspecified error [OK] [Help]
I tried to change the way the sheet is referenced using:
Sheets("Dates").Calculate
and
ActiveSheet.Calculate
to no avail. I also included error handling:
On Error Resume Next
which does not bother him. I even went as far as:
Private Sub Worksheet_Activate() On Error GoTo headache Sheets("Dates").Calculate Exit Sub headache: Exit Sub End Sub
and it is still displayed. I am completely at a loss. Help?
Additional Information
I have the following links and use them in various macros in this book:
Visual Basic for Applications
- Microsoft Excel Object Library 12.0
- OLE Automation
- Microsoft Office Object Library 12.0
- Microsoft Scripting Execution
- Microsoft Forms 2.0 Object Runtime
- Microsoft HTML Object Library
- Microsoft Internet Controls
- Microsoft ActiveX 2.8 Data Objects Library
- Microsoft ActiveX Data Objects Recordset 2.8 Library
source share