Ms Project Automation Error
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings
Automation Error Unspecified Error Vba
and policies of this site About Us Learn more about Stack Overflow vba automation error unspecified error internet explorer the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags
Automation Error Vba
Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only automation error excel takes a minute: Sign up What is causing “Automation error Unspecified error” on Worksheet_Activate? up vote 2 down vote favorite 2 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 automation error vb6 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: Private Sub Worksheet_Activate() A_Dates.Calculate End Sub 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: Microsoft Visual Basic Automation error Unspecified error [OK] [Help] I have tried changing how I reference the sheet, using: Sheets("Dates").Calculate and ActiveSheet.Calculate to no avail. I've also included error handling: On Error Resume Next which doesn't prevent it. I've even gone so far as: Private Sub Worksheet_Activate() On Error GoTo headache Sheets("Dates").Calculate Exit Sub headache: Exit Sub End Sub and it still shows up. I am totally at a loss. Help? Additional Information I have the following references, and use all of them in various macros in this workbook: Visual Basic for Applications Microsoft Excel 12.0 Object Library OLE Automation Microsoft Office 12.0 Object Library Microsoft Scripting Runtime Microsoft Forms 2.0 Object Runtime Microsoft HTML Object Library Microsoft Internet Controls Microsoft ActiveX Data Object
be down. Please try the request again. Your cache administrator is webmaster. Generated Thu, 20 Oct 2016 19:27:18 GMT by s_wx1085 (squid/3.5.20)
the VBA Run-time error ‘Automation error Library not registered.' then between your VBA project's references there is a reference to a file that is "MISSING". This is the case when for example a DLL, OCX or another VBA project used https://dutchgemini.wordpress.com/2011/01/05/vba-run-time-error-automation-error-library-not-registered/ while developing in your application is not installed on the computer the application is being used. Obviously, you should never distribute applications without making sure that the components used are available on the target computers, but there are cases in which VBA takes care of resolving the problem automatically, one example are the Microsoft Office applications, where each version installs in a separate folder containing a number (for automation error instance for Office 2003 (Release 11) you have C:\Program Files\Microsoft Office\Office11) In general, each reference is correctly mapped to the right -and probably also most recent- component, since the GUID of each application does not change. But there are cases where the component does not correctly remap (because the GUID has changed or because it is not available). If this occurs, then you will see such "MISSING" reference. To correct the problem, automation error unspecified open the VB-IDE, go to your project references (Tools -> References), either scroll the list and put or remove a checkmark in front of the desired component or browse for a file on your disk. Ah, if you have access to the project, otherwise you're out of luck. Tip: before you distribute your application, run a compile (Debug -> Compile). If there is a missing reference, VBE may make this problem evident by issuing a compile error "Can't find project or library" on a function that you know is correct (I had that on the String() function, not to confuse with VBA.String()). When you close the compiler error, VBE will open the references dialog for you. When the ‘Automation error Library not registered.' triggers on registered libraries The funny thing is that a missing reference impacts on your code when addressing the other references in the project. Suppose you want to set a reference to "Visual Basic for Applications" then you would write the following statement ("VBA" is the codename for this reference): Dim oReference As Object
Set oReference = ThisWorkbook.VBProject.References("VBA") Using a named index with missing references triggers the error. However, if you use a numeric index to obtain a reference object, the error does not trigger. Dim oReference As