Simple csv macro import works only from basic editor in new LO version. What's wrong ? [closed]

asked 2013-12-05 14:59:18 +0100

Antonello Lobianco gravatar image

updated 2014-02-05 14:55:19 +0100

I have a very simple macro that imports data in libreoffice calc from two CSV files. It has been always working but on my new laptop/new LO the first dataset is not imported, while the second it is.

Funny enought if I run the code from the BASIC editor rather than from the button I implemented, the macro works.

What could cause this different behaviour ?

The code is here: http://pastebin.com/FipK2qc0

EDIT:

Importing from line 0 didn't help.

Very weird if I run the macro from the "run macro" command I got both the importers working, while if I run it from the button associated to the macro I got only the second import to work.

To have both the importers to work from the button I need to write the first importers two times:

tempDoc = starDeskTop.loadComponentFromURL(fUrl, "_blank", 0, oPropertyValue)
copyData(tempDoc, thisDoc, fDataSheet)
tempDoc.close (-1)
tempDoc = starDeskTop.loadComponentFromURL(fUrl, "_blank", 0, oPropertyValue)
copyData(tempDoc, thisDoc, fDataSheet)
tempDoc.close (-1)
tempDoc2 = starDeskTop.loadComponentFromURL(pUrl, "_blank", 0, oPropertyValue)
copyData(tempDoc2, thisDoc, pDataSheet)
tempDoc2.close (-1)

I am starting to think this is a lo bug, as it was working with previous versions..

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by Alex Kemp
close date 2016-02-19 06:26:35.497303