create .TXT file Log

S

spence

i have this to create a txt file in excel's program files
directory. how can i modify it to put the txt file on my
C:\ drive.


Private Sub workbook_beforeclose(cancel As Boolean)
Open Application.Path & "\Log.txt" _
For Append As #1
Print #1, "Stopped " & Now
Close #1
End Sub

TIA
 
M

MicMast

or make a var above, something like this:
loc = application.path & "\Log.txt"
open loc for...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top