0
I want to run the below Excel VBA code in LibreOffice BASIC on a Raspberry PI, what results in a BASIC-runtime-error ‘423’ Cells. If I run the same VBA code on a different version of LibreOffice Calc (desktop version), it actually does work.
I already know that BASIC has limited support for VBA statements (Option VBASupport 1). Probably, the desktop LibreOffice has more support, therefore it does work there and not on the Raspberry Pi. I also see that the error results from this line of code: eRow = Sheet1.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row.
What the code does is, it searches for the next empty row of a table and prints the values I have written in X3 - X9. X10 is the amount of repetitions, because it’s for an assignment list that needs a new row for every repetition.
Rem Attribute VBA_ModuleType=VBAModule
Option VBASupport1
Sub findnextemptyrow
Dim x As Integer
eRow = Sheet1.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
enter code here
For x = eRow to eRow + Range("X10") - 1
Cells(x, 1).Value = Range("X3")
Cells(x, 2).Value = Range("X4")
Cells(x, 3).Value = Range("X5")
Cells(x, 4).Value = Range("X6")
Cells(x, 5).Value = Range("X7")
Cells(x, 6).Value = Range("X8")
Cells(x, 7).Value = Range("X9")
Since I have not much knowledge about both VBA and BASIC and I would have to delve in both languages. I was hoping this is an easy conversion for someone here. Any help is much appreciated!