When I run the following CALC macro it works.
Sub Insert_Rows(Sheet_Idx, Row, Count)
Rem *** The following three lines added to run macro independently
Sheet_Idx = 0
Row = 62
Count = 1
Rem ***
Sheets = thisComponent.Sheets
Sheet = Sheets.getByIndex(Sheet_Idx)
Sheet.Rows.insertByIndex(Row, Count)
End Sub
However, when it is called from a function it receives the error below. Can someone tell me why this happens? Thanks.
"Basic Runtime Error. An exception occurred. Type:com.sun.star.uno.RuntimeException Message.
[Solved] BASIC Runtime Error in Calc Macro
[Solved] BASIC Runtime Error in Calc Macro
Last edited by khanlon on Wed Oct 25, 2017 1:08 am, edited 2 times in total.
OpenOffice 4.1.4 / Windows 10
Re: BASIC Runtime Error in Calc Macro
Please upload a sample ODS file with the embedded FULL macro code, to see: how you call the function, how you pass the parameters, what variable type parameters are you using, etc...
Do you want to call the function from a cell?
Do you want to call the function from a cell?
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
Re: BASIC Runtime Error in Calc Macro
The code works for me as expected in AOO Calc 4.1.3.
On Windows 10: LibreOffice 24.2 (new numbering) and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
---
Lupp from München
Re: BASIC Runtime Error in Calc Macro
Yes, I am calling it from my user written function in a calc cell.
OpenOffice 4.1.4 / Windows 10
- MrProgrammer
- Moderator
- Posts: 4908
- Joined: Fri Jun 04, 2010 7:57 pm
- Location: Wisconsin, USA
Re: BASIC Runtime Error in Calc Macro
Using macro as a function. Why isn't it working?
If this solved your problem please go to your first post use the Edit button and add [Solved] to the start of the title. You can select the green checkmark icon at the same time.
If this solved your problem please go to your first post use the Edit button and add [Solved] to the start of the title. You can select the green checkmark icon at the same time.
Mr. Programmer
AOO 4.1.7 Build 9800, MacOS 13.6.3, iMac Intel. The locale for any menus or Calc formulas in my posts is English (USA).
AOO 4.1.7 Build 9800, MacOS 13.6.3, iMac Intel. The locale for any menus or Calc formulas in my posts is English (USA).
Re: [Solved] BASIC Runtime Error in Calc Macro
Thanks for the information / help.
OpenOffice 4.1.4 / Windows 10