Note that there are some explanatory texts on larger screens.

plurals
  1. POWhat is causing "Automation error Unspecified error" on Worksheet_Activate?
    primarykey
    data
    text
    <p>I have a worksheet named "Dates" (object name is A_Dates) that needs to be calculated when it is activated (It may be worth noting that this is in my Personal macro workbook). I regularly have workbooks open that have too many calculations in the for me to have auto-calculation on. So I have auto-calc set to manual, and the following code in the worksheet:</p> <pre><code>Private Sub Worksheet_Activate() A_Dates.Calculate End Sub </code></pre> <p>This has worked fine for the last 3 months, day-in and day-out. Yesterday, it stopped working. It now throws this error on the declaration line:</p> <pre><code>Microsoft Visual Basic Automation error Unspecified error [OK] [Help] </code></pre> <p>I have tried changing how I reference the sheet, using:</p> <pre><code>Sheets("Dates").Calculate </code></pre> <p>and</p> <pre><code>ActiveSheet.Calculate </code></pre> <p>to no avail. I've also included error handling:</p> <pre><code>On Error Resume Next </code></pre> <p>which doesn't prevent it. I've even gone so far as:</p> <pre><code>Private Sub Worksheet_Activate() On Error GoTo headache Sheets("Dates").Calculate Exit Sub headache: Exit Sub End Sub </code></pre> <p>and it still shows up. I am totally at a loss. Help?</p> <h1>Additional Information</h1> <p>I have the following references, and use all of them in various macros in this workbook:</p> <p>Visual Basic for Applications</p> <ul> <li>Microsoft Excel 12.0 Object Library</li> <li>OLE Automation</li> <li>Microsoft Office 12.0 Object Library</li> <li>Microsoft Scripting Runtime</li> <li>Microsoft Forms 2.0 Object Runtime</li> <li>Microsoft HTML Object Library</li> <li>Microsoft Internet Controls</li> <li>Microsoft ActiveX Data Objects 2.8 Library</li> <li>Microsoft ActiveX Data Objects Recordset 2.8 Library</li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload