Issue 9224 - Translation from VBA to StarBasic help
Summary: Translation from VBA to StarBasic help
Alias: None
Product: documentation
Classification: Unclassified
Component: Manuals (show other issues)
Version: current
Hardware: All All
: P3 Trivial with 15 votes (vote)
Target Milestone: ---
Assignee: issues@documentation
QA Contact: issues@documentation
Keywords: oooqa
Depends on:
Reported: 2002-11-14 11:02 UTC by settantta
Modified: 2012-06-15 14:53 UTC (History)
11 users (show)

See Also:
Issue Type: TASK
Latest Confirmation in: ---
Developer Difficulty: ---

Preliminary draft for early feedback V0.01 (86.64 KB, application/vnd.sun.xml.writer)
2004-05-07 23:58 UTC, masato12610
no flags Details
Utility to lists information on Spreadsheet objects (10.31 KB, application/vnd.sun.xml.calc)
2004-05-09 12:57 UTC, masato12610
no flags Details
V0.2 - Added more example coding fragments (178.89 KB, application/vnd.sun.xml.writer)
2004-05-13 01:33 UTC, masato12610
no flags Details
V0.3 - Additional example code fragments & misc. editorial changes (229.26 KB, application/vnd.sun.xml.writer)
2004-05-23 23:09 UTC, masato12610
no flags Details
Additional examples, documnet porting example, final preliminary draft (236.74 KB, application/vnd.sun.xml.writer)
2004-05-30 13:34 UTC, masato12610
no flags Details
Companion example Excel Workbook and Calc Spreadsheet to manual (77.22 KB, application/x-compressed)
2004-05-30 13:37 UTC, masato12610
no flags Details
Version 1.0: General availability of document; added material on multi-page control & pointers to reference material. (267.50 KB, application/vnd.sun.xml.writer)
2004-06-06 21:55 UTC, masato12610
no flags Details
Companion file for the manual; added example for multi-page control (86.49 KB, application/x-compressed)
2004-06-06 21:56 UTC, masato12610
no flags Details
Calendar word file (79.00 KB, application/msword)
2004-06-11 00:34 UTC, grsingleton
no flags Details
Calendar word template (63.00 KB, application/msword)
2004-06-11 00:35 UTC, grsingleton
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description settantta 2002-11-14 11:02:34 UTC
Something that has arisen on the [users] list. It would be a very useful item if
there was some sort of listing/cross reference between VBA and the equivalent
StarBasic commands/syntax. Even a simple listing of functions with the
equivalent, and notes on any factors needing attention. This would also assist
those who might  try to develov a "batch translation" routine.
Those users concerned seem to feel that a perfect translation is not essential,
provided the routine did a reasonable job.
Comment 1 scarr 2003-02-26 04:52:16 UTC
Changing to a Task so it shows up under the Doc Task list.  Thanks.
Comment 2 con.hennessy 2003-05-10 13:07:21 UTC
If there was a "Hook" in OOo which would be called to convert VBA 
to StarBasic, it would allow at least some tools to be written for limited 
uses, and may eventually build up a comprehensive convertion tool. 
This "Hook" would be for example an "event" similar to the OpenDocument 
event but would be something like "TranslateVBA" event. 
This would then allow users to add StarBasic macros to do some string 
convertions on the VBA to create StarBasic instead. 
Comment 3 scarr 2003-12-08 22:48:50 UTC
Can we get an example of some commands in VBA that need to be translated?
Comment 4 utomo99 2004-05-05 08:48:30 UTC
Hi All, 

Please look at
I hope somebody can help Michael Meek from Ximian. which I believe is related 
to this subject. Thanks.
Comment 5 masato12610 2004-05-07 23:58:37 UTC
Created attachment 15078 [details]
Preliminary draft for early feedback V0.01
Comment 6 hburford 2004-05-08 14:28:17 UTC
This is a big issue for me, as I have a number of large VBA macros which I 
really need to ue. This is the only reason I have to keep the M$ program 
available on the PC.

Even a partial equivalent-command/syntax list would be an enormous initial help.
Comment 7 masato12610 2004-05-09 12:57:46 UTC
Created attachment 15110 [details]
Utility to lists information on Spreadsheet objects
Comment 8 masato12610 2004-05-13 01:33:18 UTC
Created attachment 15215 [details]
V0.2 - Added more example coding fragments
Comment 9 utomo99 2004-05-13 03:40:48 UTC
Added Michael Meeks of Ximian (in CC) which work for issue 27344 

Utomo > Michael Meeks :
Please see some files in this issue. I hope it helps.

Comment 10 byte 2004-05-14 10:22:17 UTC
Added drbyte to CC
Comment 11 masato12610 2004-05-23 23:09:11 UTC
Created attachment 15408 [details]
V0.3 - Additional example code fragments & misc. editorial changes
Comment 12 maison.godard 2004-05-24 06:52:01 UTC
adding myself to CC 
Comment 13 stephan.wunderlich 2004-05-24 11:38:50 UTC
adding me to cc
Comment 14 masato12610 2004-05-30 13:34:33 UTC
Created attachment 15573 [details]
Additional examples, documnet porting example, final preliminary draft
Comment 15 masato12610 2004-05-30 13:37:03 UTC
Created attachment 15574 [details]
Companion example Excel Workbook and Calc Spreadsheet to manual
Comment 16 iannz 2004-05-31 00:37:33 UTC
I think this document is excellent but I would lke to make some suggestions. My
suggestions are ordered from most to least important (in my opinion):

On pg 24 the information about radio buttons is not correct. In OOo radio
buttons are grouped by being adjacent in order not by having a group control,
the group control has no effect at all.

The notes about inheritance in OOo at the start are not strictly speaking
correct. The IDL is a specification and in my experience of the few time that I
have looked at the source code inheritance is not happening but functionality is
directly coded for the object.
for some discussion about this. Mostly this doesn't matter except for when there
are optional components in which case there is no way of knowing from the IDL
whether the object you are working with has that optional component or not.

The quotes in the source code examples are "smart quotes" rather than ordinary
quotes and thus when copying and pasting them into the IDE they need to be
changed. I think it would be better if they were ordinary quotes.

In the section on dialog boxes you talk about the global variable "dlg". In OOo
a global variable is one that is available across libraries and as such having a
global valiable called "dlg" might not be a good idea (conflicts between
different libraries) and so a library level variable (declared at the module
level) might be more appropriate.

It might be good to mention for listboxes the method "addItems". Adding 900
items to a list box using addItem on my computer takes 20 seconds, using
addItems is virtually instantaneous.

In Excel there is the RefEdit control and there is no mention of how to
implement one in Calc. For a working example see MyDataPilot.sxc, module sheet
ModDPtextControls available from

While it is correct that there is no tab control in OOo there are work arounds
for implementing them using oDlg.model.step. Some such mention would be good.

The document has a routine for returning the address of a range but it doesn't
mention the rangeAddress or cellAddress structs. Given that these structs are
regularly used perhaps a routine that uses them, while less elegant, might be
more helpful. I have such routines in my MyDataPilot.sxc on module sheet _Utilities.

No where have I read something that explains directly how to use the API for 
OOo BASIC. The closest is Sun'sStarOffice 7 Office Suite - Basic Programmers
Guide, but I still feel that this, and the Developer's Guide, somehow make
assumptions that aren't obvious to everyone. I was going to write this for my
migrationfrom MO to OOo document but haven't done so yet (I lost heart in that
project, a bit, due to almost no feedback and on discovering a similar document
put out by Sun). Something like (crudely written off the top of my head):
The top of each page in the API reference has the following links:
Overview: link to the page: the top level of the API
Module: link to the second layer down for the current object
Use: link to a page where sometimes it will describe some of the places that the
current object is used.
Devguide: link to a position in a page that talks about how to use this object
usually with Java examples.
Index: link to a page with all objects starting with the letter A and has links
to the other letters in the alphabet
The second line contains links to tables on the current page
The third line contains the heirarchy for the object and this is used in the
following ways:
To create a new object depends on the type of object:
Structs: oStruct = createUnoStruct("") or          
dim oStruct as new
note the capitalisation everything up to the last item is always lowercase and
the last item is in TitleCase.

 and so on

Once again, the document VBAStarBasicXref is excellent and I learnt things from
it - thankyou. I would appreciate similar comments to the above about some of my
work and so hope that these comments are helpful.

Cheers, Ian Laurenson
Comment 17 masato12610 2004-06-06 21:55:19 UTC
Created attachment 15705 [details]
Version 1.0: General availability of document; added material on multi-page control & pointers to reference material.
Comment 18 masato12610 2004-06-06 21:56:45 UTC
Created attachment 15706 [details]
Companion file for the manual; added example for multi-page control
Comment 19 colm.smyth 2004-06-10 15:00:57 UTC
This is a very valuable task! This document focusses on Calc
macros, perhaps the title of this task should state this (and
a new task could be started for Writer).
Comment 20 masato12610 2004-06-10 22:32:38 UTC
At the risk of being getting swamped, I willing to expand the document to 
include Writer/StarBasic.  I just don't have any experience with Word/VBA.  If 
I get a few examples of Word/VBA documents, I'd take a stab at adding a mapping 
of Word/VBA to Writer/StarBasic.
Comment 21 grsingleton 2004-06-11 00:33:49 UTC
Attaching a .dot and .doc that should help
Comment 22 grsingleton 2004-06-11 00:34:45 UTC
Created attachment 15825 [details]
Calendar word file
Comment 23 grsingleton 2004-06-11 00:35:34 UTC
Created attachment 15826 [details]
Calendar word  template
Comment 24 grsingleton 2004-06-14 20:09:47 UTC
On the webpage as of 2004-06-14-08h11. Closing as completed.
Comment 25 ace_dent 2008-05-17 20:59:40 UTC
The Issue you raised has been marked as 'Resolved' and not updated within the
last 1 year+. I am therefore setting this issue to 'Verified' as the first step
towards Closing it. If you feel this is incorrect, please re-open the issue and
add any comments.

Many thanks,
Cleaning-up and Closing old Issues
~ The Grand Bug Squash, pre v3 ~
Comment 26 ace_dent 2008-05-17 23:01:38 UTC
As per previous posting: Verified -> Closed.
A Closed Issue is a Happy Issue (TM).