Error Calling External Object Function Saveas
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies error calling external object function powerbuilder of this site About Us Learn more about Stack Overflow the company Business powerbuilder application execution error (r0035) Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges powerbuilder error 35 Ask Question 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; it only takes a minute: Sign up Excel Object SaveAs, error happens when 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 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,14473147 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 32k869126 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
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 4.7 million programmers, just like you, helping http://stackoverflow.com/questions/9579658/excel-object-saveas-error-happens-when-existing-file-is-open each other. Join them; it only takes a minute: Sign up Error on Excel importing up vote 1 down vote favorite I am trying to import around 1500 Excel files to my system. The code is working in a loop and I am able open and import around 600 Excel files. After that I am getting an error http://stackoverflow.com/questions/5050888/error-on-excel-importing message like: Error calling external object function open at line 55..... I really stuck with this issue, if anyone can help that will be grateful. Code posted in reply comments: For ll_LoopCnt = 1 To Dw_1.rowcount( ) Ls_File_Name = Dw_1.getitemstring( ll_LoopCnt, "file_name") Ls_Path =Dw_1.getitemstring( ll_LoopCnt, "file_path") ll_Sr_No= Dw_1.getitemNumber( ll_LoopCnt, "sr_no") ldt_File_Date= Dw_1.getitemDateTime( ll_LoopCnt, "file_date") Excel.Application.DisplayAlerts = "False" Excel.WorkBooks.Open( Ls_Path ) Excel.Application.Visible = False Excel.windowstate = 2 // 1 : Normal, 2 : Minimize, 3 : Maximize Excel.Application.CutCopyMode = False Lb_sheet_rtn = excel.worksheets(7).Activate Ls_ClipBoard = clipboard() Excel.Application.ActiveWorkbook.Save() Excel.Worksheets(7).UsedRange.Copy ll_cnt = ds_1.importclipboard() IF ll_cnt <= 1 THEN Messagebox("Error", "Could not find.") Else Dw_1.Scrolltorow( ll_LoopCnt ) Dw_1.SetItem( ll_LoopCnt, "status", 'Success') For ll_Inner_LoopCnt = 1 To Ds_1.RowCount( ) Ds_1.Object.file_path[ll_Inner_LoopCnt] = Ls_Path Ds_1.Object.file_name[ll_Inner_LoopCnt] = Ls_File_Name Ds_1.Object.file_sr_no[ll_Inner_LoopCnt] = ll_Sr_No Ds_1.Object.file_date[ll_Inner_LoopCnt] = ldt_File_Date Next END IF Clipboard(ls_ClipBoard) Ds_1.Reset( ) //Reset the data store Excel.Application.ActiveWorkbook.Save() Excel.Application.ActiveWorkbook.Close(False); Excel.Application.Quit Excel.Application.CutCopyMode = False IF ll_LoopCnt = ll_Excel_Cnt Then //--->> After 100 files reset the memmory ll_Excel_Cnt = ll_LoopCnt + 100 Excel.DisConnectObject() DESTROY excel DESTROY TEst_Excel GarbageCollect ( ) Excel = Create OLEObject Te
and SafetyAsset NetworkAsset Operations and MaintenanceCommerceOverviewSubscription Billing https://scn.sap.com/thread/3395303 and Revenue ManagementMaster Data Management for CommerceOmnichannel CommerceFinanceOverviewAccounting http://nntp-archive.sybase.com/nntp-archive/action/article/%3C385_F0AB978564A8F6EA004D2E6285256C08.004D2E7585256C08@webforums%3E and Financial CloseCollaborative Finance OperationsEnterprise Risk and ComplianceFinancial Planning and AnalysisTreasury and Financial Risk ManagementHuman ResourcesOverviewCore Human Resources and PayrollHuman Capital AnalyticsTalent ManagementTime and Attendance ManagementManufacturingOverviewManufacturing NetworkManufacturing OperationsResponsive ManufacturingMarketingOverviewMarket error calling with Speed and AgilityUnique Customer ExperiencesReal-Time Customer InsightsR&D/EngineeringOverviewDesign NetworkDesign OrchestrationProject and Portfolio ManagementSalesOverviewCollaborative Quote to CashSales Force AutomationSales Performance ManagementSelling Through Contact CentersServiceOverviewEfficient Field Service ManagementOmnichannel Customer ServiceTransparent Service Process and OperationsSourcing and ProcurementOverviewContingent Workforce ManagementDirect ProcurementSelf-Service ProcurementServices error calling external ProcurementStrategic Sourcing and Supplier ManagementSupply ChainOverviewDemand ManagementDemand NetworkLogistics NetworkManufacturing Planning and SchedulingResponse NetworkResponse and Supply ManagementSales, Inventory, and Operations PlanningTransportation ManagementWarehouse ManagementSustainabilityOverviewEnvironment, Health, and SafetyProduct Safety and Stewardship NetworkBrowse by IndustryAerospace and DefenseAutomotiveBankingChemicalsConsumer ProductsDefense and SecurityEngineering, Construction, and OperationsHealthcareHigh TechHigher Education and ResearchIndustrial Machinery and ComponentsInsuranceLife SciencesMediaMill ProductsMiningOil and GasProfessional ServicesPublic SectorRetailSports and EntertainmentTelecommunicationsTravel and TransportationUtilitiesWholesale DistributionBrowse Platform and TechnologyAnalyticsOverviewBusiness IntelligencePredictive AnalyticsGovernance, Risk, and ComplianceEnterprise Performance ManagementApplication Platform and InfrastructureOverviewApplication PlatformContent and CollaborationInterface ManagementProcess Management and IntegrationData ManagementOverviewBig Data on HadoopData WarehousingDatabase ManagementEnterprise Information ManagementIT ManagementOverviewApplication Lifecycle ManagementIT Infrastructure ManagementSecurity SoftwareOverviewApplication and IT Infrastructure SecurityIdentity, Access and Authentication ManagementBrowse by ProductAnalyticsContent and CollaborationCustomer Relationship ManagementData ManagementEnterprise ManagementFinancial ManagementHuman Capital Ma
links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center. Forums Archive > PowerBuilder > General Discussion > "OLE error 35 (repost)" OLE error 35 (repost) 7 posts in General Discussion . Last posting was on 2002-08-02 16:47:44.0Z Mike Posted on 2002-08-01 14:03:01.0Z Newsgroups: sybase.public.powerbuilder.generalFrom: MikeDate: Thu, 1 Aug 2002 10:03:01 -0400Subject: OLE error 35 (repost)Lines: 312MIME-Version: 1.0Content-Type: text/plain; charset="us-ascii"Content-Transfer-Encoding: 7bitMessage-ID: <385_F0AB978564A8F6EA004D2E6285256C08.004D2E7585256C08@webforums>Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com!webforums.sybase.com!newsXref: forums-1-dub sybase.public.powerbuilder.general:20489 Article PK: 473278 List, This is a re-post with some additional information for a PBdebugtrace below this first note. Also below is the entire script for the event in question. Thanks, Mike I inherited an application written on PB 5.0.3 in which the below ole calls are made. In 5.0.3 it worked fine with Word 97, but I recently migrated the application to PB 8.0.1 Build 9056. In PB 8 with the same Word 97 I am getting Error number 35 errors. The below code is in the clicked event of a CB and the error "Error Number 35" "Error text=Error calling external object function saveas...." occurs during this event. As far as I can tell, the error is occuring whenever there is a "oleobject.ActiveDocument" in a line of code, for example, ole_object.ActiveDocument.SaveAs(ls_filename) //******* I have caught the return code from the connecting "ole_object.ConnectToNewObject("word.application.8") " and this is 0, indicating that the connection is working ok. I would appreciate any other leads anyone might have. Thanks much, Mike Some additional Information: The PBBugTrace is as follows for the error: End class function __GET_ATTRIBUTE for class OLEOBJECT, lib entry _TYPEDEF Executing instruction at line 126 Executing object function __INVOKE_METHOD for class OLEOBJECT, lib entry _TYPEDEF Executing system dll function Executing object function +CREATE for class OLERUNTIMEERROR, lib entry _TYPEDEF Executing instruction at line 10126 Executing object function RUNTIMEERRORCREATE for class OLERUNTIMEERROR, lib entry _TYPEDEF Executing system dll function End class function RUNTIMEERRORCREATE for class OLERUNTIMEERROR, lib entry _TYPEDEF End class function +CREATE for class OLERUNTIMEERROR, lib entry _TYPEDEF End class function __INVOKE_METHOD for class OLEOBJECT, lib e