Macro to restart Windows

Creating a macro - Writing a Script - Using the API

Macro to restart Windows

Postby Kofi » Mon Feb 25, 2019 5:08 pm

Hello,

I would like to create a macro to restart Windows when launching a calc file. How do you do that? I can't reuse my VBA script for Microsoft word.

Thank you in advance
OpenOffice 5.3.9.10 on Windows Vista
Kofi
 
Posts: 2
Joined: Mon Feb 25, 2019 5:02 pm

Re: Macro to restart Windows

Postby JeJe » Mon Feb 25, 2019 9:58 pm

I tested the code in the last post and it worked on my Windows 8 machine.

https://www.experts-exchange.com/questi ... VB6-0.html

(I googled - vb6 restart windows - and it was the first result. VB6 is very similar too OOBasic but has a much bigger code base so if you google VB6 along with what you're looking for you might easily find it)
Openoffice 4.1.6
Windows 8
JeJe
Volunteer
 
Posts: 1137
Joined: Wed Mar 09, 2016 2:40 pm

Re: Macro to restart Windows

Postby Kofi » Tue Feb 26, 2019 11:50 am

Thanks JeJe, it works great

I assigned the execution of the macro to open the file but I can't assign it only to my file. Now as soon as I open a calc spreadsheet, the macro is executed.

How do I make a macro that runs when I open my document only?
OpenOffice 5.3.9.10 on Windows Vista
Kofi
 
Posts: 2
Joined: Mon Feb 25, 2019 5:02 pm

Re: Macro to restart Windows

Postby JeJe » Tue Feb 26, 2019 11:55 am

Go to Tools/customize/events and set the macro to the Open document event for your document only. The "save in" combo at the bottom lets you set the macro for your document only.
Openoffice 4.1.6
Windows 8
JeJe
Volunteer
 
Posts: 1137
Joined: Wed Mar 09, 2016 2:40 pm


Return to Macros and UNO API

Who is online

Users browsing this forum: No registered users and 1 guest