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

Re: [tdf-discuss] Macro Difficulties


On 7 March 2013 16:43, Charles Jenkins <cejwork@gmail.com> wrote:

This is a story about the usability of LO BASIC and the documentation
thereof. And also a plea for help.

I'm trying to get LibreOffice to work with SAP Business One (hereafter
called B1) in order to eliminate the need to pay for expensive licenses for
Microsoft Excel.

B1 has a toolbar button that's supposed to generate a spreadsheet for data
viewed as a table onscreen. Unfortunately, instead of really creating a
spreadsheet, B1 just dumps out a tab-separated text file and then opens a
spreadsheet called "AutoOpen.xls" that in turn loads the text file into a
new spreadsheet.

This clunky way of doing things has the advantage that there's no worry
about file formats. Whatever version of Excel you're running, it can open
the text file. This method *could* work in LibreOffice too, but
unfortunately the macro command used in AutoOpen.xls doesn't exist in LO
BASIC. The command is Workbooks.OpenText

I'm not sure if the problem is that OpenText doesn't exist, or if there is
no Workbooks object to begin with. The documentation on LO BASIC is so
sparse that I can't find anything about opening spreadsheets. The LO help
file promises documentation at OpenOffice.org; but clicking that link takes
me instead to
https://wiki.documentfoundation.org/Documentation/BASIC_Guide, which is a
placeholder page containing only a link to another website--which doesn't
respond.

(By the way, the help file does document an Open command, but that command
is used to open simple data files to be processed and closed by the script.
It doesn't cause LO to open a document in the UI.)

After finding nothing documented, I enabled macro recording, began
recording a macro, and used File > Open to open the text file/spreadsheet
myself. Obviously, I was hoping to then examine the macro to learn what
objects and functions LO uses to open files. But opening a new file causes
macro recording to end without a comment, warning, or error…and without
saving anything of the macro in progress.

Can anyone give me clues to creating a macro which can open a spreadsheet?


Try this

http://www.pitonyak.org/oo.php

Tony

-- 
Unsubscribe instructions: E-mail to discuss+help@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

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.