[Closed] How to convert VBA code in Calc

Creating a macro - Writing a Script - Using the API

[Closed] How to convert VBA code in Calc

Postby stockman » Sat Dec 31, 2011 3:57 pm

convert VBA code in calc
I give up

Thank you for everybody help
Last edited by stockman on Sun Jan 01, 2012 6:42 pm, edited 1 time in total.
OpenOffice 3.2 on Windows Vista
Posts: 1
Joined: Sat Dec 31, 2011 2:03 pm

Re: How to convert VBA code in calc

Postby FJCC » Sat Dec 31, 2011 5:55 pm

Since this forum is not for Microsoft products, there is relatively little VBA expertise here. Can you explain what this code does? The more detail you can provide, the more likely that someone can offer suggestions about how to achieve the same effect in Calc and speed your rewriting of the code.
AOO 3.4 or 4.1 on MS Windows XP ( before 2013-08-03) or Windows 7
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
Posts: 6515
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: How to convert VBA code in calc

Postby kingfisher » Sun Jan 01, 2012 2:31 am

This document may help: Porting Excel/VBA to Calc/StarBasic. A Google search produces other sources.
Apache OpenOffice 4.1.2 (64 bit) on PCLinuxOS
User avatar
Posts: 2109
Joined: Tue Nov 20, 2007 10:53 am

Re: How to convert VBA code in calc

Postby rudolfo » Sun Jan 01, 2012 4:05 pm

In addition to what FJCC has said, about explaining what your macro code does I can already say that this is especially important in this case because your macro uses Application.OnTime, a timer functionality of MS Office that has no direct counter part in OpenOffice. In other words porting the macro to OpenOffice needs a step of reconsideration first.
It may be important to know that in contrary to MS-Office OpenOffice supports different macro languages with such advanced languages as Java or Python among them. These languages have interfaces to the OS (timer functionality, process handling, file operations, ...) out of the box, so they don't need to be re-invented on the OpenOffice side. This means for macros that manipulate Office objects Basic is an appropriate choice, but for tasks that require more complex interaction with the OS (timers, download a file from the internet) it is better to use one of the other languages, because Basic reaches its limits in that case.
Microsoft does not have this choice of different programming languages, so they stuffed any feature request into their VBA Office macro language.
OpenOffice 3.1.1 (2.4.3 until October 2009) and LibreOffice 3.3.2 on Windows 2000, AOO 3.4.1 on Windows 7
There are several macro languages in OOo, but none of them is called Visual Basic or VB(A)! Please call it OOo Basic, Star Basic or simply Basic.
Posts: 1488
Joined: Wed Mar 19, 2008 11:34 am
Location: Germany

Return to Macros and UNO API

Who is online

Users browsing this forum: No registered users and 3 guests