Visual Basic for Applications
I have a lot of Excel spreadsheets with many macros operating within these. I appreciate that Calc will load these but will REM out the lines of code as they are in VBA while Calc has its own programming language. It was my understanding that these would all need to be re-written manually in Calc basic code. However it has been suggested to me that Sun Systems or some other software producer has software which will do this conversion from VBA to Star Office Calc basic so that the sheets will function in Calc as they do in Excel. I find this very hard to believe considering the complexity of code in some situations and I am still convinced that all needs to be rewritten,. I would be very grateful if someone could confirm one way or another, as potentially a huge amount of time and expense is at stake.
Regards
Graham
[887 byte] By [
Ecocrop] at [2007-11-25 22:32:11]

# 1
Hi Ecocrop,
It is not possible to run the macros from MS Office files in StarOffice.
An imported macro cannot be run due to the difference in object models because these use different commands and methods.
In spite of this, the macros will be imported with the file and can be viewed as comments. In oder to view these: Open the file and select "Tools - Macros". In the following Macro dialog, choose your file in the field "Macro from". The different modules will be listed. Select one of these modules and click [Edit]. This will open a new window where you can view the macro source code.
In order to adapt the macros to StarOffice, you will need to do this manually.
Because this particular procedure is far too complicated to discuss here, please understand that we are not able to offer support on this topic.
Detailed information about StarOffice API, the object model, commands and methods can be found on the following web sites:
<a href="http://api.openoffice.org/" target="_blank">http://api.openoffice.org/</a>
<a href="http://api.openoffice.org/common/ref/com/sun/star/module-ix.html" target="_blank"> http://api.openoffice.org/common/ref/com/sun/star/module-ix. html</a>
# 2
Lars,
Thanks for the reply. I appreciate the complexity and the limitation of discussion but thank you for the links. What I was trying to get clarification on however was also the progress and likely availability of the macro convertor tool software which was promoted as a future release by Sun Systems last year with a target date of early this year. Can it be confirmed that this will happen or are we likely to remain with the methods you already indicated? eg if someone working in StarOffice inherits an Excel spreadsheet which is heavily programmed with VBA code for event procedures and macros, will they, if they have no programming experience be able to initiate an automatic convertor in new releases yet to come. I thank you for your patience and would value your response.
Kind Regards
Graham