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

Reply via email to