I have many csv file that I would like to add as a sheet in a calc document.
Doing manual insert file from file work fine. So I would like to make this action with a macro.
Recording it I have :
Code: Select all
sub InsertSheetFromFile
rem ----------------------------------------------------------------------
rem define variables
dim document as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
rem ----------------------------------------------------------------------
rem dispatcher.executeDispatch(document, ".uno:InsertSheetFromFile", "", 0, Array())
end sub
After many research on the net I had a lot of code that looks to be outdated, not working at all, etc...
My current understantding is that I should create an Array() containing parameters for the ".uno:InsertSheetFromFile".
Unfortunately I was not able to find any documentations about those parameters.
My config is Linux Debian / OOo 2.3.1
Could someone help me ?
Ideally, I would like the macro to start by a FileSelection dialog allowing to select mutiple csv files and then insert one sheet per selected file...
thanks you for your answers !
Luc