|
|||||||||||||||||
|
Home > VBA to OO 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. Submit VBA to OpenOffice Basic Code Conversion Snippets 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 >> |
|
||||||||||||||||
|
|||||||||||||||||
| © 2013 Business Spreadsheets. All Rights Reserved. Legal | About Us | |||||||||||||||||