Hello,
After migrating one project from Windows Legacy to Windows (Studio version 23.4.5) I’m getting the following error during runtime.
“Invoke VBA AutoFit: Cannot run the macro ‘AutofitAllUsed’. The macro may not be available in this workbook or all macros may be disabled.”
All the macro settings in Excel/Trust Center are correct.
The macro is saved inside the project in a .txt file and is invoked using the “Invoke VBA” activity. It cannot be saved inside the target excel file.
Sub AutofitAllUsed()
Dim x As Integer
For x = 1 To ActiveSheet.UsedRange.Columns.Count
Columns(x).EntireColumn.autofit
Next x
End Sub
This part is running without errors in Windows Legacy version of the project.
Any help would be greatly appreciated!