ONLYOFFICE Workspace 12.5: enhanced security, optimized document management, Dark theme, and more
ONLYOFFICE Workspace 12.5 released

Export sheet to csv from a macro

Hello everybody,
I am quite new to Onlyoffice and Onlyoffice macro development. I have started work on a German Accounts Speadsheet, where I make heavily use of macros. So far everything is fine, due to the API-Documetation. (Thanks for that).
What I cannot find is a means of either writing to a textfile (I guess that is due to JavaScript restrictions - I am equally new to JavaScript) or export a sheet or part of it to a csv-file invoked by a macro.
Can anybody help?
Thanks a lot
Document Server version:
Installation method:
Browser version:

Hello @Dimpflmoser

Sorry for the late reply.
Unfortunately, you cannot create separate files with macros from editors interface.
But you can create files without opening editors with Document Builder. There is an instance of Document Builder comes with the Document Server package and available via POST requests to it. Refer to this article to find out how to use it:

Hello everybody, hello Constantine,

thanks very much for your reply - as you can see, I’m late too.

This sounds very interesting, but sadly, as I’m quite new to both OnlyOffice and JavaScipt, I must admit, I don’t really understand how to create a document from a macro. At least I’m nut sure whether I need to install something and …
I’m currently working with the StartUp plan.
So here my questions:
Is it possible to use DocumentBuilder with this Version?
Is there somewhere a step by step example for document creation? - so far I have only proceeded so far, that I know that the given examples produce a reference error right in the line:
So I guess I’m completely wrong - but do not look through the given link with the post-request either???
Sorry for being so stupid.
Thanks in advance - so

Hello again @Dimpflmoser

As I said earlier - you cannot create and download separate files by using macros. They allow you to work with an existing document and its content when it is opened with our editors.
Please pay attention that macro is not the same as Document Builder. Document Builder is a separate tool that allows you to create documents without need to run actual editors.

Unfortunately, Document Builder is not included into this solution. So if you want to use it you will have to either install a stand-alone version of Document Builder or install Document Server with built-in Document Builder.

Here are the links that will be helpful: - General information about Document Builder; - ‘Try now’ page to practice script writing for Document Builder.

Document structures and examples of document creation and opening can be found in these articles: - for text documents; - for spreadsheet documents; - for presentation documents; - for form documents.