Ole Error 800a03ec Saveas
Contents |
here for a quick overview of the site Help Center Detailed answers to excel output failed ole error 800a03ec any questions you might have Meta Discuss the workings and
Microsoft Office Excel Error '800a03ec'
policies of this site About Us Learn more about Stack Overflow the company Business Learn 800a03ec vbscript error more about hiring 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 a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Saving Excel workbook as PDF gives me an OLE error 800A03EC up vote 1 down vote favorite I have the following function that I want to use for creating a PDF from Excel. But when trying to save the PDF I get an OLE error 800A03EC that I simply can't figure out. I use the same approach to create PDF from Word and that works just fine. function xlsCreatePdf(aInput: string; aOutput: string = ''): string; var FileDoc: OleVariant; FilePDF: OleVariant; ExcelBook: ExcelWorkbook; PdfName: string; ExcelApp: ExcelApplication; begin Result := ''; if aOutput = '' then begin PdfName := Folders.DirOutput + ExtractFileName(aInput); PdfName := ChangeFileExt(PdfName, '.pdf'); end else PdfName := aOutput; if (Files.Validate(aInput)) then begin if not Assigned(ExcelApp) then ExcelApp := xlsInitialize; FileDoc := aInput; ExcelBook := ExcelApp.Workbooks.Open(FileDoc, EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam, DefaultLCID); FilePdf := PdfName; ExcelBook.SaveAs(FilePdf, xlTypePDF, EmptyParam, EmptyParam, False, False, xlNoChange, xlUserResolution, False, EmptyParam, EmptyParam, EmptyParam, DefaultLCID); xlsFreeAndNil(ExcelApp); if (Files.Validate(PdfName)) then Result := PdfName else Result := ''; end; end; I initialize Excel using function xlsInitiali
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 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 a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Ole 800A03EC error when using TExcelWorkBook SaveAs method in http://stackoverflow.com/questions/30774976/saving-excel-workbook-as-pdf-gives-me-an-ole-error-800a03ec Delphi 7 up vote 4 down vote favorite 3 I am trying to open excel 2003 workbook and save it as something else, for example excel 95. I use the following code: XLSApp:=TExcelApplication.Create(Self); XLSApp.Workbooks.Open(SomeFileName,NULL,false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,defaultlcid); XLSWB:=TExcelWorkbook.Create(XLSApp); XLSWB.ConnectTo(XLSApp.Workbooks.Item[1]); XLSWB.SaveCopyAs(ExtractFilePath(edTable.Text)+'temp.xls'); XLSWB.SaveAs(SomeOtherFileName,xlExcel7,EmptyParam,EmptyParam,False,False,xlNoChange,xlUserResolution,False,EmptyParam,EmptyParam,EmptyParam,DefaultLCID); Unfortunately this code gives "Ole 800A03EC" on clients computer, while it works on mine. Note that I have Office 2007 installed, and he has Office 2003 SP3. Any help would http://stackoverflow.com/a/11264140 be very much appreciated. delphi excel automation ole share|improve this question edited Mar 2 '10 at 7:37 The_Fox 6,06122758 asked Mar 1 '10 at 13:15 Tofig Hasanov 71362359 add a comment| 4 Answers 4 active oldest votes up vote 9 down vote accepted I have seen this error once when automating Excel. It happened when the user had a cell in editmode and you tried to automate that instance. Excel doesn't like it when you are editing a cell and some program is fiddling around in the background. So this is what's happening at your client (I think): Your client has Excel open and is editing a cell (select a cell and press F2) Your code starts: You create a TExcelApplication and accesses the Workbooks property. Since your Excel application is not yet connected it calls TOleServer.Connect (look at the implementation of GetDefaultInterface) Since the default connectkind is ckRunningOrNew, TExcelApplication connects to the running instance. Because the client is editing a cell you get an error on the Open method. How you can prevent this: Set ConnectKind of your TExcelApplication to ckNewInstance so you'll always work in a separate Excel instance. share|improve this answer answered Mar 1 '10 at 14:01 The_Fox 6,06
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 http://stackoverflow.com/questions/9579658/excel-object-saveas-error-happens-when-existing-file-is-open Us Learn more about Stack Overflow the company Business Learn more about hiring 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 a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Excel Object SaveAs, error happens when ole error Existing File is Open up vote 0 down vote favorite Excel_Obj = CREATE OleObject Excel_Obj.ConnectToNewObject( 'excel.application' ) Excel_Obj.Workbooks.Add Excel_Obj.Application.ActiveWorkbook.WorkSheets.Add Excel_Sheet = Excel_Obj.Application.ActiveWorkbook.WorkSheets[1] //EXAMPLE Excel_Sheet.Cells[1,1] = 45 Excel_Obj.Application.ActiveWorkbook.SaveAs(ls_file,56) //csv //where ls_file = the Opened File error happened after / during saveas. try catch throw "error calling external object..in click..line.. saveas.." -- i want to state to the user that the excel file is open therefore cannot be ole error 800a03ec overwritten properly. I used a try catch and throwed a proper message but before the messagebox for the catch event happens, the PB execution error R0035 happens. any solutions or proper way to know if the excel file is open. excel ms-office ole powerbuilder share|improve this question edited Apr 7 '14 at 19:09 Kara 3,16973148 asked Mar 6 '12 at 7:39 Sid 32711742 add a comment| 5 Answers 5 active oldest votes up vote 0 down vote You might be able to check if the file is open first, have a look at this answer: how to check if file is opened in excel using OLE (leaves excel process open) share|improve this answer answered Mar 6 '12 at 12:47 Colin Pickard 32.1k869126 i could do those using try catch in Powerbuilder. the true problem relies on the PB Execution Error upon knowing the file is open. not before. i also put it inside try, but the error still popped out. i dont think my users will ignore this,lol –Sid Mar 7 '12 at 1:04 i still need some help on this. I havent figured this out. my users want a perfect excel