What is causing “Automation error Unspecified error” on Worksheet_Activate?

前端 未结 9 2653
庸人自扰
庸人自扰 2020-12-15 00:32

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 workbo

相关标签:
9条回答
  • 2020-12-15 00:36

    I found the issue. One of my forms had a control on it that apparently stopped working, and this had a ripple effect.

    The control in question was "Microsoft ProgressBar Control, version 6.0". I do not know WHY it stopped working, but removing the form (and, of course, all references to it) resolved the issue.

    0 讨论(0)
  • 2020-12-15 00:38

    My fix on this problem was to add the following references in VBA - Tools - References.

    Microsoft ActiveX Data Objects 2.8 Library Microsoft ActiveX Data Objects Recordset 2.8 Library

    0 讨论(0)
  • 2020-12-15 00:40

    Try to compile your program to a lower version of the OS.

    0 讨论(0)
  • 2020-12-15 00:45

    I saw this error pop up as a dialog box right before Excel stopped working. I was debugging a new script that opens several hundred excel files and pulls some info from each one. To resolve, I added several 'DoEvents' commands and my issue with this error went away immediately.

    0 讨论(0)
  • 2020-12-15 00:48

    Just a note for other people coming with "automation error". I had one too and found it to be a special case of integer overflow where it would break in the loop and give automation error instead of the integer overflow error. If you didnt find a solution above check if you are using the correct dimensions.

    0 讨论(0)
  • 2020-12-15 00:55

    I just had this problem, no luck with removing the loading controls or adding/moving references.

    Fixed by adding a DoEvents for Internet Explorer like so:

    Do
      DoEvents
    Loop Until ie.readyState = READYSTATE_COMPLETE
    

    Note too, that this value can bounce between "complete" and "busy" so a more robust loop here may be beneficial.

    0 讨论(0)
提交回复
热议问题