Is this possible to create new ods file in Macro? And write

Discuss the spreadsheet application

Is this possible to create new ods file in Macro? And write

Postby arrowman » Tue Feb 12, 2019 3:25 pm

Hello.
I would like to create new ods file and next create new sheet in this file and write in cells.
Is this possible in Macro?

Here I have found how it works for text files (csv):
https://www.debugpoint.com/2014/12/file ... ing-basic/
But I can't find for ods.

Thanks,
A.
OpenOffice 3.2.1, Windows XP/Vista
arrowman
 
Posts: 8
Joined: Mon Nov 21, 2011 12:01 pm

Re: Is this possible to create new ods file in Macro? And wr

Postby Zizi64 » Tue Feb 12, 2019 3:50 pm

I would like to create new ods file and next create new sheet in this file and write in cells.
Is this possible in Macro?


Yes, it is possible.
Tibor Kovacs, Hungary; LO4.4.7, LO6.1.5 on Win7-10 x64Prof.
PortableApps, winPenPack: LO3.3.0-6.2.1 and AOO4.1.5
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
User avatar
Zizi64
Volunteer
 
Posts: 7778
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Is this possible to create new ods file in Macro? And wr

Postby RoryOF » Tue Feb 12, 2019 4:00 pm

It would be easier to make a Calc file that did the requisite calculations, and use a macro (if necessary) to insert the new values from whatever application generated these.
Apache OpenOffice 4.1.6 on Xubuntu 18.04.2 (mostly 64 bit version) and very infrequently on Win2K/XP
User avatar
RoryOF
Moderator
 
Posts: 28430
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Is this possible to create new ods file in Macro? And wr

Postby Zizi64 » Tue Feb 12, 2019 4:51 pm

I would like to create new ods file and next create new sheet in this file and write in cells.

Depended on the settings, 1 or 3 sheets already exits, when you open the default template. (The method of the creating a new Calc file by macro is: open the default template file.)

Here are some sample code snippets
viewtopic.php?f=20&t=44142&p=203852
viewtopic.php?f=20&p=410921

https://www.openoffice.org/api/docs/com ... oader.html
Tibor Kovacs, Hungary; LO4.4.7, LO6.1.5 on Win7-10 x64Prof.
PortableApps, winPenPack: LO3.3.0-6.2.1 and AOO4.1.5
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
User avatar
Zizi64
Volunteer
 
Posts: 7778
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary


Return to Calc

Who is online

Users browsing this forum: Google [Bot] and 20 guests