How to log message when you are running macro/vba script

hello guys

wanted to check how to log message when you are running macro/vba script
be it execute macro activity or invoke VBA activity

Thanks

@Vikram212… have you tried Parallel activity?

Yes but thats not helpful to track whats happening within 2000 lines of code

Hey @Vikram212,

Check this link, it may help:

So u need to track the steps in VBA activity while it is running right?

I think we can able to get an output from VBA that too only after executing the script. If you want to get some data from VBA you can follow this:

Eg. To return the name of the worksheet name to UiPath from the Macro:

Private Function SheetNameMacro() As String

Dim SheetName As String
SheetName = ActiveSheet.Name, vbInformation, "Active Sheet Name"

SheetNameMacro = SheetName 
End Function

SheetNameMacro is the function name and also the return value. This value will be returned to UiPath Macro Output variable.