[Solved] Basic Macro to Recalculate Spreadsheet

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
saleem145
Posts: 130
Joined: Mon Jul 02, 2012 4:47 pm

[Solved] Basic Macro to Recalculate Spreadsheet

Post by saleem145 »

Hello,

I am interested in writing a OO Basic Macro that will recalculate spreadsheet. How can I do this??

Thanks in advance,

Saleem
Last edited by saleem145 on Sun Jul 15, 2012 1:55 pm, edited 2 times in total.
OpenOffice 3.4.0
Mac OS X 10.5.8
User avatar
Charlie Young
Volunteer
Posts: 1559
Joined: Fri May 14, 2010 1:07 am

Re: Basic Macro to Recalculate Spreadsheet

Post by Charlie Young »

saleem145 wrote:Hello,

I am interested in writing a OO Basic Macro that will recalculate spreadsheet. How can I do this??

Thanks in advance,

Saleem

Code: Select all

Sub Calculate()
	ThisComponent.calculateAll()
End Sub
Apache OpenOffice 4.1.1
Windows XP
User avatar
Villeroy
Volunteer
Posts: 31348
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Basic Macro to Recalculate Spreadsheet

Post by Villeroy »

You can call any command by an ordinary hyperlink or hyperlink button:
.uno:AutomaticCalculation toggles automatic calculation (menu:Tools>Content>Auto Calculation)
.uno:Calculate calculates all "dirty cells" depending on modified cells when auto calc is off (key F9)
.uno:CalculateHard calculates the whole document (key Ctrl+Shift+F9)
Please, 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
Post Reply