[Solved] Using Macro to open existing file in a new instance
-
johnnyideal
- Posts: 6
- Joined: Wed Nov 02, 2016 1:20 am
[Solved] Using Macro to open existing file in a new instance
Hi, I am new with OO, I am trying to figure out how to open use a macro in a spreadsheet to open an existing saved spreadsheet in a new window. Thanks.
Last edited by johnnyideal on Thu Nov 10, 2016 9:39 pm, edited 1 time in total.
OpenOffice 4.1.2 on Windows 7
Re: Using Macro to open existing file in a new instance
To open a file called CellRangeIndexing.ods that is on my desktop:
Code: Select all
FileName = "c:\users\fjcc\desktop\CellRangeIndexing.ods"
FileURL = convertToURL(FileName)
StarDesktop.loadComponentFromURL(FileURL, "_blank", 0, Array())OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
Re: Using Macro to open existing file in a new instance
New instance as if it were a template?
Code: Select all
sub open_as_template(sPathName)
sURL = convertToURL(sPathName)
dim a(0) as new com.sun.star.beans.PropertyValue
a(0).Name = "AsTemplate"
a(0).Value = True
StarDesktop.loadComponentFromURL(sURL, 0, "_blank", a())
end subPlease, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice