+ Reply to Thread
Results 1 to 7 of 7

Excel 2013 Automation Error

  1. #1
    Registered User
    Join Date
    11-06-2013
    Location
    Phoenix, az
    MS-Off Ver
    Excel 2013
    Posts
    26

    Excel 2013 Automation Error

    Would anyone know why a macro that works without a problem in Excel 2010 now crashes Excel 2013. The error produced says 'Automation Error Exception Occurred'. If I place a stop in the code and hold the F8 key down, the code runs perfectly (Excel 2013) but if I run it, it will crash. The code is copying a worksheet into a new workbook, adding 2 more worksheets, saving then emailing the workbook before closing. It goes through the routine about 7 times before crashing (sending only 7 email out). It's something to do with the email because I can bypass that code and it runs that part without a problem.

    Our office just upgraded all the computers to Office 2013 and I've got to get this macro running again. I had to email 100 reports one-by-one today and I didn't like it.

    I can put code up if anyone thinks it might help. But like I said the code works if I step through it.

    Thanks

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

    Re: Excel 2013 Automation Error

    I do not have the answer. I have seen automation errors before and they can be rather insidious to diagnose. It can be very specific to your configuration. I have moved from 2010 to 2013 and have not experienced what you describe. You might want to check the libraries you have referenced. You may have to re-reference the Outlook library if you are using Outlook to send the email.

    The worst automation error I had was when I installed Project 2010, which did not automatically uninstall 2007. I had not even considered this for quite a while but when I uninstalled 2007 the problem went away. That is not related to your problem, just pointing out that automation errors are not well documented by Microsoft and difficult to diagnose.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    11-06-2013
    Location
    Phoenix, az
    MS-Off Ver
    Excel 2013
    Posts
    26

    Re: Excel 2013 Automation Error

    I haven't referenced any libraries and the macro will email the first 7 or 8 reports (workbooks) before crashing. For the heck of it I turned on the Outlook library but it didn't make any difference, still crashed. We checked system resources and everything seems normal. I tried puting a 2 second pause to allow Outlook to have time to do what ever it needed but it made no difference (I even tried 10 seconds). It seems to have something to do with passing the files to Outlook. It will only take 7 or 8 then it crashes. Is there a buffer somewhere that needs adjusting? This is really frustrating!

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

    Re: Excel 2013 Automation Error

    I don't understand how your code works if it's not referencing the Outlook object library. Can you post all your code? Or post your entire file with private data removed?

  5. #5
    Registered User
    Join Date
    11-06-2013
    Location
    Phoenix, az
    MS-Off Ver
    Excel 2013
    Posts
    26

    Re: Excel 2013 Automation Error

    OK, I guess I've stumped everyone. I would still like to get this macro working again so I'll put the code up (you asked for it!). Since this post I threw together another spreadsheet that does nothing bu email all our reports. The code is directly out of what you see below. The only real difference is the new macro isn't building a workbooks while emailing.

    I double checked and I do not have any Outlook libraries turned on. But everything works (in the my revised macro anyway). But like I said, I would really like to resolve the issue this code seems to have.

    The code to email begins around line number 620. This is one of the few routines I used line numbers on because I expected to have problems with it. So With line numbers it will tell me the line the error occured. But with an Automation Error that is not the case!
    Any help would be appreciated.
    Please Login or Register  to view this content.
    Last edited by Bukovnik; 03-28-2014 at 06:20 PM.

  6. #6
    Registered User
    Join Date
    11-06-2013
    Location
    Phoenix, az
    MS-Off Ver
    Excel 2013
    Posts
    26

    Re: Excel 2013 Automation Error

    Here's an update to the problem.
    To run our reports I bypassed the email portion of the code. Part of that subroutine was adding 2 more tabs and copying some data. I left that part in. When I ran the reports the other day I got another Automation Error as it was building those additional tabs. It produced about 6 to 8 complete reports before the error. So the error has nothing to do with email. It seems as though Excel 2013 is overwelmed when it has about 22 to 28 open workbooks.
    I placed a break in the code for that operation. When the macro hit the break I would hit F5 to continue. Everything worked fine. Of course everytime it looped back around to the break I would hit F5 and it would build the reports without a problem. If I try to let it run without a break I get the error.
    Anyone got any ideas?

  7. #7
    Registered User
    Join Date
    02-28-2010
    Location
    California
    MS-Off Ver
    Excel 2003, Excel 2007, Excel 2010
    Posts
    2

    Re: Excel 2013 Automation Error

    I'm having the same problem with Excel 2010, but with only 2 workbooks open. When searching for this problem on the internet, I see that a lot of other people have this same problem. Does anyone have a hint, an idea, a guess??

    The problem is so intermittent, that sometimes a simple "doevents" added to the code will fix it. But only for a while. As soon as another userform is modified, the automation error returns.

+ 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. #NAME? Error with Excel 2013
    By xMaximus in forum Excel Formulas & Functions
    Replies: 22
    Last Post: 02-24-2014, 11:12 AM
  2. Facing 'run-time error -2147217871 (80040e31) Automation error' in excel VBA
    By junaidanjum in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-25-2013, 03:48 AM
  3. [SOLVED] VBA error in excel 2013
    By zepp in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-26-2013, 02:47 AM
  4. Encounter Automation Error in Jan 2013 for my VBA Program in Dec 2012
    By Laura_Wu in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-27-2013, 11:06 PM
  5. Replies: 7
    Last Post: 01-15-2010, 02:34 PM

Tags for this Thread

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