Basic Runtime Error 12 - OOo 3.3

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
calpeda
Posts: 13
Joined: Thu Jun 26, 2008 11:34 am

Basic Runtime Error 12 - OOo 3.3

Post by calpeda »

Hi,
i ve just installed OO 3.3 and when I try to execute my macro (working in previous 3.2) I got

"BASIC runtime error '12' ActiveSheet"

example:

costototale = ActiveSheet.Cells(i, 5).Value

In general I m getting a similar error everytime I m using ActiveSheet component.

May someone help me?
Thank you in advance.
OOo 3.0.X on Ms Windows XP
User avatar
Hagar Delest
Moderator
Posts: 32658
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: Basic Runtime Error 12 - OO 3.3

Post by Hagar Delest »

Can you post the full code? Perhaps there is another parameter that needs to be changed in 3.3.
LibreOffice 7.6.2.1 on Xubuntu 23.10 and 7.6.4.1 portable on Windows 10
User avatar
Charlie Young
Volunteer
Posts: 1559
Joined: Fri May 14, 2010 1:07 am

Re: Basic Runtime Error 12 - OOo 3.3

Post by Charlie Young »

calpeda wrote:Hi,
i ve just installed OO 3.3 and when I try to execute my macro (working in previous 3.2) I got

"BASIC runtime error '12' ActiveSheet"

example:

costototale = ActiveSheet.Cells(i, 5).Value

In general I m getting a similar error everytime I m using ActiveSheet component.

May someone help me?
Thank you in advance.
It would appear that you were formerly using some kind of VBA compatibility tool.

Code: Select all

costototale = ActiveSheet.Cells(i, 5).Value
In VBA, this refers to row i, column 5 on the ActiveSheet.

In OOo Basic, this would be

Code: Select all

costototale = ThisComponent.CurrentController.ActiveSheet.getCellByPosition(4,i - 1).Value
Since OOo coordinates are column first and 0 based.
Apache OpenOffice 4.1.1
Windows XP
Post Reply