Unable to run a simple code
Good day to all, please i am kind of new to libreOffice and i am trying to run a piece of code that i previously tried on Excel and worked. but i cant seem to correct the problem with Libreoffice. The task is simple, i am trying to assign a copy action to a button, but the target cell will be extracted from the value inside another cell ( a picture is attached). the VBA code that worked perfectly in excel and showed me errors in Libreoffice was:
Private Sub CommandButton1_Click()
With Worksheets("Sheet1")
.Range("K10").Copy Destination:=.Range(.Range("K6").Value)
End With
End Sub
Your code clearly is "very Excel-VBA". Since I don't feel sure about what you actually meant I cannot edit your post using the tool for posting code without a risk to introduce errors.
Concerning general issues with moving VBA code to LibreOffice, you may read the recent thread https://ask.libreoffice.org/en/questi....
Well, meanwhile I verified the code and edited the question to make it (as I think) a bit better readable.
It uses typical VBA constructs an syntax and cannot run in native LibreOffice Basic.
However, it was correctly executed under
Option VBAsupport 1
.