Hi all!
I'm getting an error at Open MyFile For Output As fnum
I think there may be a problem with:
MyFile = ActiveWorkbook.Path & "\" & "Point_on_XY_" & Date & "_" & Time & ".scr"
Any ideas?
Sub WriteToATextFile()
'first set a string which contains the path to the file you want to create.
'this example creates one and stores it in the root directory
MyFile = ActiveWorkbook.Path & "\" & "Point_on_XY_" & Date & "_" & Time & ".scr"
'set and open file for output
fnum = FreeFile()
Open MyFile For Output As fnum
'write project info and then a blank line. Note the comma is required
'Write #fnum, "I wrote this"
'Write #fnum,
'use Print when you want the string without quotation marks
Print #fnum, A1
Close #fnum
End Sub
I'm getting an error at Open MyFile For Output As fnum
I think there may be a problem with:
MyFile = ActiveWorkbook.Path & "\" & "Point_on_XY_" & Date & "_" & Time & ".scr"
Any ideas?
Sub WriteToATextFile()
'first set a string which contains the path to the file you want to create.
'this example creates one and stores it in the root directory
MyFile = ActiveWorkbook.Path & "\" & "Point_on_XY_" & Date & "_" & Time & ".scr"
'set and open file for output
fnum = FreeFile()
Open MyFile For Output As fnum
'write project info and then a blank line. Note the comma is required
'Write #fnum, "I wrote this"
'Write #fnum,
'use Print when you want the string without quotation marks
Print #fnum, A1
Close #fnum
End Sub