Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index


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: users+help@global.libreoffice.org
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

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.