I’ve recently started using LibreOffice, and for a few days I was able to use Calc to run VBA macros in a .xlsm spreadsheet that was originally created in Excel. However, after a few days I am getting errors on a macro that used to work in Calc. I now get a “BASIC runtime error. Property or method not found: Activate” error message on the “ThisWorkbook.Activate” line of the code below. There is much more code in the macro, but with an error message on the first real line of code with such a basic line of code, it makes me wonder if there’s some sort of global configuration setting that got changed somehow. I have macro security set to Medium and I have enabled macros.
Rem Attribute VBA_ModuleType=VBAModule
Option VBASupport 1
Sub Complete_button()
ThisWorkbook.Activate
Dim taskName, taskRow, numTasks
Dim dash As Worksheet
Dim data As Worksheet
Set dash = ThisWorkbook.Sheets("Dashboard")
Set data = ThisWorkbook.Sheets("Task List")
If I erase the ThisWorkbook.Activate line, then I get a similar error with the ThisWorkbook.Sheets lines. I’m sure at some point I may need to learn LibreOffice’s own macro language and migrate my VBA macros over to it, but I mostly want to learn why a macro that was working in Calc is suddenly failing to run.