Problem encountered with Debug.Print message being passed to subroutine
I have developed a DebugSupport class that gives the option of directing Debug.Print output to Immediate Window or Immediate Window and disk file or disk file only. This class has a method output_line. So, in my code I replace
Debug.Print "Line: " & "Test stuff"
with
Public dp as New DebugSupport
dp.output_line ("Line: " & "Test stuff")
This works fine. However if the Debug.Print message contains formatting functions such as Tab() or Spc(), then I get a compile error i.e.
dp.output_line ("Line: "; Tab(10); "Test stuff") Compile error
So, my question is how do I pass such a message into a subroutine.
The method output_line does two things. It puts the input argument into a Debug.Print statement and then prints it to disk. I assume that the Tab() function is specific to Debug.Print and that I would have to supply some code to replicate this formatting control while printing to disk. That is not difficult. But I am stumped by the compile error.
Thanks
|