Im trying to create a simple log function in my Excel VBA project.
I want to pass the current procedure name and a string
the log function looks currently like this:
Public Sub log(procName As String, message As String)
dolog (procName & ": " & message)
End Sub
I am trying to call it like this:
Dim C_PROC_NAME As String
C_PROC_NAME = "autoSave"
log(C_PROC_NAME, "test")
That does not work, it excpects me to do it like this:
test = log(C_PROC_NAME, "test")
And initializing the C_PROC_NAME like this does NOT work as well:
DIM C_PROC_NAME As String = "autoSave"
If you want to call a sub with parens, you need to place a
Callkeyword in front:Or you can call it without parens: