Piping debug info to a txt file

  • Thread starter Thread starter Ben
  • Start date Start date
B

Ben

Hi all,

Is there a way to, first, shell out command prompt and create a text file.
Then, pipe (append) debug info, such as variable values at different stages
into the text file. I tried to do a debug.print, but it gets cut off after a
certain number of times. By the time code execution is done, only the end
portion appears in the immedidate windows. The top portion is chopped off.

Thanks,

Ben



--
 
You can use the Open statement to open a file in Append mode and Print
whatever you are now Debug.Print'ing to it instead. The exact set up depends
on where you are running your code from, but I'm thinking something like
this:

Start your output session before you run your code...

FF = FreeFile
Open "c:\temp\yourfilename.txt" For Append As #FF

Run your code and use this to write what you now Debug.Print...

Print #FF, <<Your Output Text>>

When your code is finished, don't forget....

Close #FF

Rick
 
Back
Top