-------- Original Message -------- Subject: Re: [libreoffice-users] python reading calc Date: Sun, 23 Sep 2012 18:12:10 +0100 From: dutchguy69 <[email protected]> To: webmaster-Kracked_P_P <[email protected]> Have done another test this time with ods sheet and that is working fine with same code. Next test with excel sheet that is actually produced by excel itself and that works as well. Seems this has something to do with my sheet which comes from an external source and although I can open it without issue within excel I can not using libreoffice. Also an attempt to convert is not working. On 23/09/12 16:03, webmaster-Kracked_P_P wrote:
Sorry but the URLs are actually pointing to your "tmp" folder on your Linux machine, and not a valid accessible file[s]. On 09/23/2012 09:30 AM, dutchguy69 wrote:I have created a python script to open and read information from an excel sheet with libreoffice on linux running in headless mode. This is working fine on 3.4 but on a newer version of libreoffice this is no longer working The error: File "./test-Opening.py", line 109, in ReadNewPositions oSheet = oDoc.getSheets().getByName( "Excel Sheet" ) Code extract: oDoc = StarDesktop.loadComponentFromURL( cURL , "_blank", 0, () ) print "oDoc.__class__:", oDoc.__class__, ";URL:", cURL # select the sheet that is called "Excel Sheet" oSheet = oDoc.getSheets().getByName( "Excel Sheet" ) Print: 3.5.4.13-3.1: oDoc.__class__: <type 'NoneType'> ;URL: file:///tmp/ExcelSheet.xls 3.4.2.6-4.2.2: oDoc.__class__: None ;URL: file:///tmp/ExcelSheet.xls It seems to me that the return from StarDesktop.loadComponentFromURL returns a different type between the 2 LO versions which leads to the error in line 109 trying to open a specific sheet. Did some research but have not found many leads yet. Hoping someone might be able to shed some light on this.
-- For unsubscribe instructions e-mail to: [email protected] Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/ Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette List archive: http://listarchives.libreoffice.org/global/users/ All messages sent to this list will be publicly archived and cannot be deleted
