Automation Error Exception Occurred Vba
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring automation error exception occurred project 2010 developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question
Automation Error Exception Occurred Excel 2010
x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them;
Automation Error Exception Occurred Excel 2013
it only takes a minute: Sign up Sporadic Automation Error: Exception Occurred, Possibly Reference Based up vote 0 down vote favorite 1 My team has had this strange error bugging us during development. From time to time when running VBA on an excel tool that my team is building, Excel will crash and the "Microsoft has stopped working" pop-up will appear and when the user selects the 'close the program' option another pop-up stating "Automation Error Exception Occurred" appears. Now here is where it gets weird: It only happens on the machines running 2007, 2010 and 2013 machines never have this issue. Only happens every couple weeks (every 3-5 versions of the tool). These same machines have been running and testing the tool all day every day up until the point it occurs. There is no noticeable difference between the versions that work and those that don't from a code perspective. The have been several instances where a machine will run the VBA code fine and suddenly the error will start occurring. Once, a 2007 machine encounters the error, that file will never work on that machine or any other 2007 machine again. BUT, if given a fresh copy of the same exact file, sometimes the problem will disappear. after some online review, I have tracked the error down to three references being used: OLE Automation, Microsoft Office 12.0 Object Library, Microsoft CDO for Windows 200 Library. If any of these three are disabled in any combination the VBA will start running bug-free. My questions are: What could cause an error that would allow a tool to work a dozen times on a machine (with or without changes being saved) and suddenly stop running and never run again until replaced with a fresh copy? What possible interactions between the three above references could be related to this? vba excel-vba excel-2007 share|improve this question edited May 24 '14 at 3:22 Jamal 56361625 asked May 7 '14 at 19:46 BenW301 70112 1 Are you using any ActiveX controls not provided as standard by the VBA editor toolbox (i.e. Treeview, Listview, etc)? I had a si
when creating SaveAs file dialog If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. Results 1 to 5 of 5 Thread: [RESOLVED] [Excel 2010] Automation Error when creating SaveAs file dialog Tweet Thread Tools Show Printable Version Subscribe to this Thread… Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode Apr 20th, 2011,01:18 PM #1 UberChemist View Profile View Forum Posts Thread Starter New Member Join Date Apr 2011 Posts 8 [RESOLVED] http://stackoverflow.com/questions/23526974/sporadic-automation-error-exception-occurred-possibly-reference-based [Excel 2010] Automation Error when creating SaveAs file dialog I have many macros in my personal workbook (PERSONAL.XLSB), and so when I close all open workbooks the Excel application window stays open and I can still use the Visual Basic editor to edit these macros. I have narrowed my problem down to this: Code: Sub Tester() Dim MyDialog As FileDialog Set MyDialog = Application.FileDialog(msoFileDialogSaveAs) End Sub When I execute this code with a workbook open http://www.vbforums.com/showthread.php?647755-RESOLVED-Excel-2010-Automation-Error-when-creating-SaveAs-file-dialog (like the default Book1), this works fine. If I close all workbooks and execute this code, then I get the following error: Automation error Exception occurred. Then the windows error reporting system chimes in with "Microsoft Excel has encountered a problem and needs to close." and the application closes. I can post the details of the error report if it would help, but otherwise I'll spare you. The error does not occur with the other three types of file dialog (FilePicker, FolderPicker, Open). I want to use this as part of a larger macro that will create a new workbook with certain parameters that I specify, and I need the SaveAs dialog to be able to create a new file. I'd like it to run regardless of whether other workbooks are open. Any ideas? Reply With Quote Apr 20th, 2011,02:41 PM #2 nO_OnE View Profile View Forum Posts Hyperactive Member Join Date Oct 2010 Location Indiana Posts 455 Re: [Excel 2010] Automation Error when creating SaveAs file dialog The problem is probably because you are telling it to save something when there's nothing there. If you need the save as dialog to show up, why not create a template with your parameters, then copy it as... Or even just open a new workbook first within your macro, then add the changes. The new
Forum Microsoft Office Application Help - Excel Help forum Excel Programming / VBA / Macros Excel 2013 Automation Error To get replies by our experts at nominal charges, follow this link to buy points and post your thread in our Commercial Services forum! Here is the FAQ for this forum. http://www.excelforum.com/showthread.php?t=999513 + Reply to Thread Results 1 to 7 of 7 Excel 2013 Automation Error Thread Tools Show Printable Version Subscribe to this Thread… Rate This Thread Current Rating Excellent Good Average Bad Terrible Display Linear Mode Switch https://www.experts-exchange.com/questions/28308782/Excel-crashes-when-running-Macro-with-Automation-Error.html to Hybrid Mode Switch to Threaded Mode 03-25-2014,07:34 PM #1 Bukovnik View Profile View Forum Posts Registered User Join Date 11-06-2013 Location Phoenix, az MS-Off Ver Excel 2010 Posts 24 Excel 2013 Automation Error Would anyone know why a macro that automation error 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). automation error exception 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 Register To Reply 03-25-2014,09:05 PM #2 6StringJazzer View Profile View Forum Posts Visit Homepage Forum Moderator Join Date 01-27-2010 Location Tysons Corner, VA, USA MS-Off Ver 2010, 2013, 2016 Posts 9,298 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 Making the world a bet
Help Receive Real-Time Help Create a Freelance Project Hire for a Full Time Job Ways to Get Help Ask a Question Ask for Help Receive Real-Time Help Create a Freelance Project Hire for a Full Time Job Ways to Get Help Expand Search Submit Close Search Login Join Today Products BackProducts Gigs Live Careers Vendor Services Groups Website Testing Store Headlines Experts Exchange > Questions > Excel crashes when running Macro with Automation Error Want to Advertise Here? Solved Excel crashes when running Macro with Automation Error Posted on 2013-12-03 MS Excel Visual Basic Classic 1 Verified Solution 31 Comments 2,150 Views Last Modified: 2013-12-06 Hi, Excel crashes when I press a button which runs a macro userform1.show OR when I use auto_open. If I go into the vba code and run it line by line, the program works fine. Once excel has crashed and windows recovers the file, I then get an "Automation Error" box pop up asking me to close the application. I am using Excel 2013 on one computer and Excel 2010 on another, the issue happens on both. Part of my code is pasted below - Please let me know if you need the full code to help identify the issue. Sub StartPro() Haulage.Show End Sub Select all Open in new window which calls Private Sub UserForm_Activate() Me.MultiPage2.Value = 0 End Sub Private Sub UserForm_Initialize() TextBox1.Value = Format(Date, "dd/mm/yyyy") Label4.Caption = Format(Sheets("PHCosts").Range("F2").Value, "Currency") Label5.Caption = Format(Sheets("PHCosts").Range("G2").Value, "Currency") Sheets("Haul").Select 'Registration comboboxes With Me.ComboBox1 .RowSource = Range("A2", Sheets("Haul").Range("A2").End(xlDown)).Address End With With Me.ComboBox22 .RowSource = Range("A2", Sheets("Haul").Range("A2").End(xlDown)).Address End With