+ Reply to Thread
Results 1 to 18 of 18

Automation error Exception occurred

  1. #1
    Forum Contributor
    Join Date
    12-01-2007
    Location
    USA-North Carolina
    MS-Off Ver
    MS Office 2016
    Posts
    2,671

    Automation error Exception occurred

    Hi,

    I got this error the other day. It was not on my computer but a friends computer. THey got this error when they try to run a macro. If i run the macro i do NOT get the error.

    I have NO idea why this is happening.

    Another interesting thing is that if my friend goes to developer menu then visual basic and presses the Run , and Run Macro........macro actually runs to completion.

    I have googled this but to be honest i am lost........any ideas would be greatly appreciated.

    FYI: i can not post the code.
    Attached Images Attached Images

  2. #2
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,550

    Re: Automation error Exception occurred

    Re: "i can not post the code."
    Begs the question "Why not"
    Experience trumps academics every day of the week and twice on Sunday.

  3. #3
    Forum Contributor
    Join Date
    12-01-2007
    Location
    USA-North Carolina
    MS-Off Ver
    MS Office 2016
    Posts
    2,671

    Re: Automation error Exception occurred

    Any thoughts on what to do? What could cause this?

  4. #4
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,252

    Re: Automation error Exception occurred

    If I tell you that something hurts me, are you able to tell what hurts me? I don't think so. Without analyzing the code, you can't answer that question.

    Artik

  5. #5
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,550

    Re: Automation error Exception occurred

    Re: "Any thoughts on what to do?"
    Yes, inspect the code.

  6. #6
    Forum Contributor
    Join Date
    12-01-2007
    Location
    USA-North Carolina
    MS-Off Ver
    MS Office 2016
    Posts
    2,671

    Re: Automation error Exception occurred

    ok, while i was hoping for something more let me ask another question.

    are any of you aware of what type of an error would/could cause such an error like "Automation error Exception Occurred". Is there a general thing to consider?

  7. #7
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow Re: Automation error Exception occurred


    Quote Originally Posted by welchs101 View Post
    Any thoughts on what to do? What could cause this?
    Hi,

    obviously just a bad code …

  8. #8
    Forum Contributor
    Join Date
    12-01-2007
    Location
    USA-North Carolina
    MS-Off Ver
    MS Office 2016
    Posts
    2,671

    Re: Automation error Exception occurred

    Just wanted to provide an update on this issue.

    Turns out that if macro is run from "hard-drive" it runs fine no issues.

    But if it runs from one-drive then one gets the error i mentioned.

    I had a few others run from one drive and they had no problems. So it seems like this issue is

    isolated to one computer. As long as it runs from physical hard drive on lap top then it runs ok.


    Any thoughts on this one?

  9. #9
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,252

    Re: Automation error Exception occurred

    This is not a forum for fairies. We're not going to guess what you have in code that you haven't even shown one line of.

    Regarding OneDrive, take a look at this thread: https://www.mrexcel.com/board/thread.../#post-6124378

    Artik

  10. #10
    Forum Contributor
    Join Date
    12-01-2007
    Location
    USA-North Carolina
    MS-Off Ver
    MS Office 2016
    Posts
    2,671

    Re: Automation error Exception occurred

    i have stayed away from childish remarks, i only wish the people here would do the same. 

    I have posted valid questions only to be met with immature childish comments, how rude indeed.

    Even if the code was posted it would do not good. The error does not occur at the same place every time.

    if you have never seen this error before i wish you would just say that instead of calling people fairies or whatever else.

    If you have no idea what could cause this type of error i wish you would just say that.

  11. #11
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow Re: Automation error Exception occurred


    As any guessing challenge has no place whatever the Excel VBA forum !

    So just debug your code in step-by-step mode in order to see where it fails …
    You may search on web too according to the environment.

  12. #12
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,252

    Re: Automation error Exception occurred

    I have posted valid questions only to be met with immature childish comments, how rude indeed.
    I answered you that such a described problem can not be answered without analyzing the code. The error message is as generic as "Oops, something went wrong". Your first post could point to 100,000 causes. Your post #8 narrows that number down to 10,000. Without knowing any context of how the code works, it is still impossible to answer fairly accurately about the causes of the error.
    Have I seen such an error in the past? Over the course of more than 15 years I've watched it many times, so I know what I'm saying about the impossibility of answering.
    Even if the code was posted it would do not good. The error does not occur at the same place every time.
    And here you may be wrong. By analyzing the code and knowing where (or which places) the error occurs, perhaps one could point to a solution. But since your project is secret and you can't share even a piece of code, the error problem will still remain yours.
    I wish you good luck.

    Artik
    Last edited by Artik; 11-23-2023 at 10:21 PM.

  13. #13
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,550

    Re: Automation error Exception occurred

    Re: "Even if the code was posted it would do not good"
    I honestly can't comprehend why you ask for help because you seem to know it all.
    If nothing else, your crystal ball is a lot better then ours.

  14. #14
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2404
    Posts
    24,809

    Re: Automation error Exception occurred

    welchs101, when you post a question about an error raised by VBA code it is helpful to have the file. If the file cannot be provided for any reason, it is absolutely essential to have the code. Without the code and without knowing what line raised the error, we have no way to even guess what could be causing your problem. This is a very general kind of an error. Even if the error occurs in different places, it is important to know the details. If all you want is a general "These are the possible causes of an automation error" it would be more productive to do a general web search. Asking a question in this forum is better for specific, targeted questions.

    To all others posting in this thread

    I appreciate the desire to have more information from the OP. If you are not getting what you feel you need to offer a solution, you can simply move on to the next thread. There is no need for sarcastic comments. The following type of comment is not appropriate and repeated occurrences will result in infractions.

    Re: "Any thoughts on what to do?"
    Yes, inspect the code.
    obviously just a bad code …
    This is not a forum for fairies.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  15. #15
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,813

    Re: Automation error Exception occurred

    I know some folk don't like to be advised to "just Google it" but sometimes it is the best way to generate some ideas and suggestions. In this case, it is a very generic error and you will find lots of possibilities and suggested solutions.

    I apologise in advance if you have already done this. So, just Google: excel vba Automation error Exception Occurred

    This will get pages of suggestions.

    Do you get an error number? That could narrow down the options.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  16. #16
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,813

    Re: Automation error Exception occurred

    I'm not really an advocate of AI based answers but this looks like quite a practical diagnostic approach.

    User
    Cause of excel vba Automation error Exception Occurred?

    ChatGPT
    An "Automation error" in Excel VBA can occur for various reasons. It often indicates a problem with interacting with external objects or libraries. Common causes include:

    Reference Issues: Check if any referenced libraries are missing or incompatible. Open the VBA editor, go to Tools > References, and ensure all selected references are available.
    Version Compatibility: Ensure that your VBA code is compatible with the version of Excel you are using. Some code may not work across different Excel versions.
    Object Creation Issues: If you're working with external objects (e.g., creating Word or Outlook objects), ensure that the corresponding applications are installed and accessible.
    Security Settings: Excel's security settings might be blocking certain actions. Check macro security settings and ensure macros are enabled.
    Memory Issues: Large data sets or inefficient code can cause memory-related problems. Optimize your code and check for memory leaks.
    Corrupted Workbook: In rare cases, a corrupted workbook can lead to automation errors. Try creating a new workbook and copying your code to see if the issue persists.
    Windows Update: Ensure that your Windows operating system and Excel are up to date with the latest updates.

    Debugging using breakpoints and error handling can help pinpoint the issue. If the problem persists, providing more specific details about your code and the context of the error would be helpful for further assistance.



    One other suggestion I saw was to add Option Explicit at the start of your code and compile it. Again, if you have already done this, we are guessing in the dark a little.

  17. #17
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow Re: Automation error Exception occurred


    Quote Originally Posted by 6StringJazzer View Post
    To all others posting in this thread

    I appreciate the desire to have more information from the OP. If you are not getting what you feel you need to offer a solution, you can simply move on to the next thread. There is no need for sarcastic comments. The following type of comment is not appropriate and repeated occurrences will result in infractions.
    That's wrong as my so called 'comment' is very not sacarstic but just a fact according to the very poor initial post !
    Did not you notice 'bad' in italic ?!
    So the OP should obviously understand he must post his code like indicate which codeline raises the error …
    Without any material, this is a guessing challenge which has no place whatever the Excel forum,
    he has more chances to find out himself with a web search.

  18. #18
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2404
    Posts
    24,809

    Re: Automation error Exception occurred

    Quote Originally Posted by Marc L View Post
    That's wrong as my so called 'comment' is very not sacarstic but just a fact according to the very poor initial post !
    Did not you notice 'bad' in italic ?!]
    It's obvious that if the code doesn't work, there is a problem with the code. We don't need to be told the problem is "bad code."

    There is no need to post in this thread unless you are going to offer a solution, offer troubleshooting steps, or ask questions. Posting only to say that the initial post is poor is not helpful.

    I am not going to entertain any further discussion about this. Any posts that don't move the thread towards a solution in a supportive way will be deleted.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. what does Exception occurred message mean?
    By Osprey3 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-23-2023, 09:53 AM
  2. [SOLVED] Automation Error - Exception Occurred when looping through files
    By amartin575 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-27-2017, 09:42 PM
  3. Solver - Automation Error Exception Occured
    By godonnell06 in forum Excel General
    Replies: 5
    Last Post: 03-23-2016, 04:43 AM
  4. MS Excel w/ userform & macros - Receive "Automation error Exception ocurred" message
    By MileHigh_PhD in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-25-2014, 01:54 AM
  5. [SOLVED] UserForm Error - Exception Occurred
    By Aland2929 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-02-2011, 11:26 AM
  6. User Form - Exception Occurred
    By Riggers in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-20-2011, 05:03 PM
  7. Exception Occurred excel form vba
    By cclambie in forum Excel General
    Replies: 0
    Last Post: 12-08-2005, 11:20 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1