Excel Vba Automation Error The Server Threw An Exception
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions excel vba automation error exception occurred you might have Meta Discuss the workings and policies of excel vba automation error the object invoked has disconnected from its clients this site About Us Learn more about Stack Overflow the company Business Learn more about hiring excel vba automation error catastrophic failure developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is
Excel Vba Automation Error System Call Failed
a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Excel 2007: “Automation Error” when sorting data using VBA (80010105) up vote 0 down vote favorite I'm running a VBA script from an Excel file that opens another file, manipulates data and excel vba automation error unspecified error some charts, then saves it. Everything works perfectly except when I try to sort data. When I get to the line .SortFields.Add Key:=Range("J3:J11")... I get an error Run-time error '-2147417851 (80010105)': Automation error The server threw an exception I'm sure it has something to do with the way I'm referencing the Excel object, but I've tried everything and can't seem to find a solution. The sorting code was borrowed from the macro recorder and modified. Private Sub button1_Click() Dim path As String Dim exl As Excel.Application path = ActiveWorkbook.path & "\" Set exl = CreateObject("Excel.Application") With exl .Workbooks.Open path & "bin\Integrated UPSIDE with Summary.xlsm" <...other code...> With .Worksheets("Summary").Sort .SortFields.Clear .SortFields.Add Key:=Range("J3:J11") _ , SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:=xlSortNormal .SetRange Range("C2:P11") .Header = xlYes .MatchCase = False .Orientation = xlTopToBottom .SortMethod = xlPinYin .Apply End With <...other code...> .Workbooks.Close End With exl.QUIT End Sub Any suggestions are GREATLY appreciated! Thanks excel-vba runtime-error share|improve this question asked Mar 30 '12
be down. Please try the request again. Your cache administrator is webmaster. Generated Sat, 15 Oct 2016 09:46:39 GMT by s_ac15 (squid/3.5.20)
Analytics Conference: Oct 18, Mastering SAP BI, Melbourne: Oct 23, FLBOUG, Clearwater: Oct 28, ASUG http://www.forumtopics.com/busobj/viewtopic.php?t=35995&sid=1a57ab0621648f43105365fe60c1ac4a Northern California: Nov 2, ASUG Arizona Chapter: Nov 3, ASUG http://www.mrexcel.com/forum/excel-questions/563501-automation-error-server-threw-exception.html All Texas Chapter Meeting: Nov 11. Automation Error - The Server threw an Exception Search this topic...|Search SDK (VBA/ASP/JSP)...|Search Box Select a search Explain These Choices... --------------------Recent Topics (All Forums) Unanswered Posts Register or Login to Post automation error Forum Index -> SDK (VBA/ASP/JSP) Author Message BombjackForum MemberJoined: 29 Nov 2004Posts: 11Location: Germany Posted: Mon Nov 29, 2004 9:15 amPost subject: Automation Error - The Server threw an Exception Hi everyone, Iīm using a Visual Basic 6 Application with BO 5.1.8 for refreshing and distributing our regular reports. It really excel vba automation worked fine for about three years, but for some reason it began throwing these automation errors (error code 2147417851) two weeks ago. I really have no clue what happened, we didnīt update anything - it just stopped working right in time for christmas business Whatīs most frustrating: Thereīs no pattern or a specific codeline, it seems to happen completely random while opening, refreshing, printing, saving or exporting a document. I helped myself by trapping the error, quitting the bo session, creating a new application object and resuming the code until it works. Works most times, but it costs much time and sometimes BO crashes. Here are some parts of my code where the errors occur, any hints? Code: Dim bo As New Application, doc As Document bo.Visible = False bo.Interactive = False bo.LoginAs user, passwort, False Set doc = bo.Documents.Open(pfad) doc.Refresh doc.Save doc.PrintOut CStr(rs!Path) doc.Reports.Item(CStr(rs!Report)).PrintOut CStr(rs!Path) doc.Reports.Item(CStr(rs!Report)).PrintOut CStr(rs!Path) doc.Reports.Item(CStr(rs!Report)).ExportAsText CStr(rs!Path) & Left(CStr(rs!Document)
Forums Excel Questions Automation Error: The Server threw an Exception Results 1 to 8 of 8 Automation Error: The Server threw an ExceptionThis is a discussion on Automation Error: The Server threw an Exception within the Excel Questions forums, part of the Question Forums category; Hey fellas, so the idea here is doing a sort of a giant set of data in a seperate workbook. ... LinkBack LinkBack URL About LinkBacks Bookmark & Share Digg this Thread!Add Thread to del.icio.usBookmark in TechnoratiTweet this thread Thread Tools Show Printable Version Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode Jul 11th, 2011,03:40 PM #1 lucigen New Member Join Date Jun 2011 Posts 15 Automation Error: The Server threw an Exception Hey fellas, so the idea here is doing a sort of a giant set of data in a seperate workbook. Leading up to this point in the code we have xlSht defined as a sheet object, getXcoX is an integer. Last is a little routine to get the desired endpoint. I know for a fact that xlSht and getXcoX are valid since they are used earlier in the program. Code: xlSht.Activate xlSht.Columns("A:M").Select listMax = last(getXcoX, xlSht) 'Sorting bit xlSht.Sort.SortFields.Clear xlSht.Sort.SortFields.Add Key:=Range(Cells(1, getXcoX).Address), SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:=xlSortNormal It errors out on the last line with the following message: Runtime error '- 2147417851 (80010105): Automation error the server threw an exception A google search didn't reveal any information about the runtime error with anything related to excel or within my comprehension. Anyone got a clue what that means? I would really like to avoid writing my own sorting algorithim EDIT: Before anyone stsarts working on this, I think I am an idiot. The Range(Cells(1,getXcoX).address) thing isn't working properly. Don't think too hard on this guy Last edited by lucigen; Jul 11th, 2011 at 03:47 PM. Share