I'm making some progress. Here's my code so far: 

==============

Public Sub OpenExcelFile(excelPath As String)

  Attempt1:
    on error goto Fail1

    ' <snip> The Excel method that doesn't work
    ' under LO, and which I don't own copyright to
    exit sub

  Fail1:
    resume Attempt2

  Attempt2:
    dim starDesktop as object
    dim url as string
    dim doc as object
    dim dummy() ' Empty array of parameters

    starDesktop = createUnoService("com.sun.star.frame.Desktop")
    url = ConvertToUrl( ExcelPath )
    doc = starDesktop.loadComponentFromURL( url, "_blank", 0, dummy )

End Sub 

==============

The problem is, since the file output by SAP ends with the ".txt" extension, 
Calc opens the new file as a Writer document, not a spreadsheet.

I think I need what is described in 
http://knowledgebase.progress.com/articles/Article/P147655 -- an extension that 
can wrap strings into the property values required by loadComponentFromUrl(), 
so I can fill the array of parameters in a way that tells LO it will be loading 
the text file into a spreadsheet.

Does anyone out there happen to have experience with such an extension, or know 
how to get the open-source code for something similar? (The LO Extensions site 
has a CSV-opening extension, but I'd have to modify it to remove the UI, and 
there's no indication at all of how to get the source!)

--

Charles


-- 
Unsubscribe instructions: E-mail to discuss+h...@documentfoundation.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.documentfoundation.org/www/discuss/
All messages sent to this list will be publicly archived and cannot be deleted

Reply via email to