Page 1 of 1
Can we use VBA to program in Calc?
Posted: Thu Apr 07, 2011 6:01 pm
by christian09
Just trying to learn it VBA and macros and want to practice in excel, but don't have it.
Re: can we use vba to program in calc?
Posted: Thu Apr 07, 2011 6:31 pm
by Zizi64
Hi,
Just trying to learn it VBA and macros and want to practice in excel, but don't have it.
can we use vba to program in calc?
The simple answer is: NO!
The VBA and OOBasic not compatible! (Maybe there are some VBA routines wich can run in OpenOffice)
In other words: The OpenOffice can run some VBA routine, but MSO can not run any OpenOffice API routine!
If you want learn and practice VBA programming: you need buy MSOffice.
The OpenOffice have API, macro-, and several programming language feature (for example: OOBasic) but they are not same as MSOffice features.
You can solve every tasks in OpenOffice, what you can achieve in MSOffice, but in another way.
Re: can we use vba to program in calc?
Posted: Thu Apr 07, 2011 6:37 pm
by Villeroy
Do yourself a favour and learn the most fundamental programming basics in some modern language. Then you will be able to handle VBA and you will understand why VBA (and all other Basic dialects) are dead. The remaining zombies are the macro languages of two office suites. Unfortunately OOo is one of the two.
Re: can we use vba to program in calc?
Posted: Thu Apr 07, 2011 7:00 pm
by christian09
thanks for the advice. Which of the languages would you see is a good one to learn if I want to transform an open office calc sheet and is also widely used in other applications?
Re: can we use vba to program in calc?
Posted: Thu Apr 07, 2011 7:12 pm
by JohnSUN-Pensioner
The office suite answer

:
Re: can we use vba to program in calc?
Posted: Thu Apr 07, 2011 7:25 pm
by christian09
Thanks JohnSun
So I think I will look to learn python, and use it in open office calc?
Re: can we use vba to program in calc?
Posted: Thu Apr 07, 2011 7:27 pm
by RoryOF
A good starting test is "A Byte of Python"; Google should find this for you. I think OpenOffice uses v 2.6 (or 2.7) not v 3.
Re: can we use vba to program in calc?
Posted: Thu Apr 07, 2011 7:30 pm
by Villeroy
The formula language of a spreadsheet is a simplified programming language for non-programmers. If you abstain from all macros and express the whole programming logic in spreadsheet formulas, Excel will handle the file correctly. Save your spreadsheet in the old Excel file format (*.xls) and everything will work properly without macros.
As Tibor explained, you need MS Office software to learn VBA. Quite often a VBA programmer never learns to program anything else. VBA is the ring to bind them all.
If you want to use another programming language with MS Office or OpenOffice.org you first need to learn how to program anything else in that particular language. Real programming languages are not related to office suites.
Then you may use that language to talk to this program or another program. You may also control a database, a graphic program (Photoshop), a Windows system or something. The main difference is the thing you talk to once you know how to talk anything.
The OOo Basic language can be seen as a subset of VBA but you've got to say very different things in the same language. You have to send different commands that are understood by the respective target application. MS Office and OOo are very different programs. 2 cars may look the same with very similar properties even when you sit on the driver seat. But one is a Diesel, the other one is run on batteries. "Gas" means nothing to the E-car while "Ampere" refers to something different in the Diesel.