Macro samples
The following examples will show you how to use ONLYOFFICE macros and compare the JavaScript code with
Microsoft Visual Basic for Applications code so that you could see the difference and understand what can be done to convert the VBA code to ONLYOFFICE macros.
-
Write data to worksheet cell
In this example we are writing the data (the "Hello world" phrase) to fourth column of the third row of the worksheet.
More
-
More
-
More
-
More
-
More
-
More
-
Set column width
In this example we are setting the width for the second ("B") column.
More
-
More
-
Add chart
In this example we are creating the chart from the data in the "C5:D7" cell range.
More
-
Highlight duplicates
In this example we are highlighting duplicates in the selected area with different colors to recognize duplicated values quickly.
More
-
Next blank row
In this example we are finding the next available blank row in a worksheet.
More
-
In this example we are inserting text into the document at the current cursor position.
More
-
In this example we are returning information about the exchange rates for the last several days and fill in the table with the received values.
More
-
In this example we are importing data from remote CSV/TXT files into the spreadsheet.
More
-
This macro repeatedly recalculates worksheet cell values within one-second intervals.
More
-
In this example we are unhiding all the rows and columns in a worksheet.
More
-
In this example we are removing shapes from the presentation.
More
-
In this example we are inserting a unique id into the OFORM.
More
Support
If you want to request a feature or report a bug regarding macros, use the issues section on GitHub.
You can also request a macro sample by contacting us at marketing@onlyoffice.com.