[Solved] VBA macro to toolbar button

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
gust
Posts: 5
Joined: Mon Sep 06, 2010 9:59 am

[Solved] VBA macro to toolbar button

Post by gust »

Hey!

I draw the short straw at work and got tasked with converting all our MS Word templates to OO.

All macros seems to work when the template is opened in OO but in MS Word we have a toolbar with the macros assigned to buttons in the toolbar.

My question is: Is there a way to add macros written in VBA to a toolbar in OO?

thanks!
Last edited by gust on Mon Sep 06, 2010 11:54 am, edited 1 time in total.
OpenOffice 3.2
Windows 7
User avatar
floris v
Volunteer
Posts: 4431
Joined: Wed Nov 28, 2007 1:21 pm
Location: Netherlands

Re: VBA macro to toolbar button

Post by floris v »

You can do that with Tools - Customize.

If your problem has been solved, please edit the first post in this thread and add [Solved] to the title bar.
OpenOffice 4.1.11 on Ubuntu; LibreOffice 6.4 on Linux Mint, LibreOffice 7.6.2.1 on Ubuntu
If your problem has been solved or your question has been answered, please edit the first post in this thread and add [Solved] to the title bar.
Nederlandstalig forum
gust
Posts: 5
Joined: Mon Sep 06, 2010 9:59 am

Re: VBA macro to toolbar button

Post by gust »

Sorry its really not that simple, When OO imports the VBA macros it creates a Sub around all VBA subs and then comments them out so you cant choose one of the VBA subs.
OpenOffice 3.2
Windows 7
esperantisto
Volunteer
Posts: 578
Joined: Mon Oct 08, 2007 1:31 am

Re: VBA macro to toolbar button

Post by esperantisto »

VBA is not supported in OOo (in standard builds, at least), is it? Thus, there’s no reason of adding buttons to the toolbar anyway.
AOO 4.2.0 (of 2015) / LO 7.x / Win 7 / openSUSE Linux Leap 15.4 (64-bit)
gust
Posts: 5
Joined: Mon Sep 06, 2010 9:59 am

Re: VBA macro to toolbar button

Post by gust »

esperantisto wrote:VBA is not supported in OOo (in standard builds, at least), is it? Thus, there’s no reason of adding buttons to the toolbar anyway.
Ok, that sucks, then i have to convert them manually :(
OpenOffice 3.2
Windows 7
User avatar
floris v
Volunteer
Posts: 4431
Joined: Wed Nov 28, 2007 1:21 pm
Location: Netherlands

Re: VBA macro to toolbar button

Post by floris v »

You said that the macros seemed to work? I was a bit surprised about that. Maybe you should try go-oo, that has better support for Excel VBA macros.
OpenOffice 4.1.11 on Ubuntu; LibreOffice 6.4 on Linux Mint, LibreOffice 7.6.2.1 on Ubuntu
If your problem has been solved or your question has been answered, please edit the first post in this thread and add [Solved] to the title bar.
Nederlandstalig forum
gust
Posts: 5
Joined: Mon Sep 06, 2010 9:59 am

Re: VBA macro to toolbar button

Post by gust »

floris v wrote:You said that the macros seemed to work? I was a bit surprised about that. Maybe you should try go-oo, that has better support for Excel VBA macros.
yeah i thought so but upon some more research it seems like the styles already are in the template and not added by the macros in the template
OpenOffice 3.2
Windows 7
User avatar
floris v
Volunteer
Posts: 4431
Joined: Wed Nov 28, 2007 1:21 pm
Location: Netherlands

Re: VBA macro to toolbar button

Post by floris v »

I see, then you have some hard work ahead.
OpenOffice 4.1.11 on Ubuntu; LibreOffice 6.4 on Linux Mint, LibreOffice 7.6.2.1 on Ubuntu
If your problem has been solved or your question has been answered, please edit the first post in this thread and add [Solved] to the title bar.
Nederlandstalig forum
gust
Posts: 5
Joined: Mon Sep 06, 2010 9:59 am

Re: VBA macro to toolbar button

Post by gust »

floris v wrote:I see, then you have some hard work ahead.
don't know about hard but certainly boring :P
OpenOffice 3.2
Windows 7
esperantisto
Volunteer
Posts: 578
Joined: Mon Oct 08, 2007 1:31 am

Re: VBA macro to toolbar button

Post by esperantisto »

The matter is, there’s no automatic or semi-automatic conversion of VBA into SB, you have to re-write the code. Well, good luck!
AOO 4.2.0 (of 2015) / LO 7.x / Win 7 / openSUSE Linux Leap 15.4 (64-bit)
User avatar
RoryOF
Moderator
Posts: 34618
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: [Solved] VBA macro to toolbar button

Post by RoryOF »

I found a site that purports to do some automatic conversion of VBA to OpenOffice BASIC. How good or bad it is I cannot say but you could try it out:
http://www.business-spreadsheets.com/vba2oo.asp
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
Post Reply