[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2341
  • Last Modified:

Debug.Print to Text File

What is the best way in which to send a Debug.Print to a text file?
0
eciabattari
Asked:
eciabattari
  • 2
1 Solution
 
RogueSolutionsCommented:
Why use Debug.Print?

Instead create a text file using ...

Open "MyFile.txt" FOR Output AS #1

Print #1, strTheDebugPrintStatement

Close #1



0
 
RogueSolutionsCommented:
Actually, I should have said you should use FreeFile() to get the filehandle and assign it to a variable (global if necessary)

You also want to Open the file once - not for each "Debug.Print" you want.  Each call to Open removes the previous file unless you start using For Append instead of For Output


0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now