This is the best I can find to create a textfile and save a string variable's contents to it. Logically it doesn't make sense to me since you would first need to "create" a file before "opening" it, so either I just don't get it, or this is wrong.
Either way, it's not working, and generates the error: Run-time error '52': Bad file name or number
What am I doing wrong?
-Ovatvvon :-Q
Either way, it's not working, and generates the error: Run-time error '52': Bad file name or number
What am I doing wrong?
Code:
'Saves to Text File
Dim strUserText As String
strUserText = "This is a bunch of text to save in a textfile."
Open "c:\ProgramLogs\Log_" & Date$ & ".log" For Output As #1
Print #1, strUserText
Close #1
-Ovatvvon :-Q