Home > VBA to OO Basic Converter Share

Convert VBA to OpenOffice Basic

Microsoft Excel VBA to OpenOffice Calc Basic converter


Business Spreadsheets has developed a service to assist in the conversion of Excel VBA code to the equivalent OpenOffice Calc Basic script. The VBA to OO Basic converter does not completely convert Excel VBA macros to OO Basic macros for Calc nor seamlessly migrate Excel VBA projects to OpenOffice environments.


While much of the underlying logic behind OpenOffice Basic compares to that of Visual Basic for Applications, there exists fundamental differences to the way the code is constructed. This Excel VBA to OpenOffice Basic converter offers a starting point for migrating VBA projects in Excel to the OpenOffice or Star Office Calc application. The converter may also serve as a learning mechanism to better understand the similarities and differences between the VBA and OO Basic coding specifications.

 

Reference should be made to the material for Porting Excel/VBA to Calc/Star Basic at OpenOffice.org when undertaking migrations from Microsoft Excel to OpenOffice or Star Office Calc.

 

The Excel VBA to OO Calc Basic Converter uses code snippet pairs of VBA and OO Basic with place holders so that replacements can be made using regular expressions. Users of the converter are encouraged to submit such snippets here in a community effort to strengthen the results of the VBA to OO Basic conversion process. A full list of current Excel VBA to OO Basic code snippet pairs can be viewed here.

 

To find assistance, make suggestions or share experiences about using this converter, please see the Help Forum. Business Spreadsheets also offers the free Bond Yield to Maturity Calculator in both Excel VBA and OpenOffice Basic with open source code as an example of an Excel VBA project migrated to OpenOffice Calc.


Paste Excel VBA code:

that, by using this converter, Business Spreadsheets gives no warranty of any kind, express or implied, with regard to the accuracy, completeness or the outcomes of using any of the conversion results.

Convert VBA

Submit VBA to OpenOffice Basic Code Conversion Snippets
You are encouraged to submit your own code snippets to add to the database of VBA to OpenOffice code pairs used for the conversion process. The conversion process executes regular expressions of the VBA code with placeholders so that references to objects can be retained and placed in the appropriate place of the OpenOffice Basic equivalent. To utilize this, please read the instructions below before submitting. All submissions will be reviewed before inclusion.

VBA Code Pattern:
OO Basic Format:
Submit Pair
Instructions:
Code snippets should be at the lowest level of granularity possible meaning that VBA code should be split into the smallest components possible and still have an OpenOffice Basic equivalent.

In order to use regular expressions effectively it is best to illustrate with a existing code pair as an example.

VBA Code Pattern: Range(.*?).Offset(.*?,.*?).Value
OO Basic Format: ThisComponent.CurrentController. ActiveSheet.getCellRangeByName($1). getCellByPosition($2,$3).Value

Note that the $ signs followed by the numbers in the OO Basic Format represent the order of the .*? content in the VBA code - i.e. $1 is will be replaced by the content of the first instance .*? in the VBA Code Pattern and so on. More detailed information on applying more complex regular expression conversions can be found here.

Current VBA to OO Basic Code Snippet Pairs:Show >>