Seamus2626
asked on
Temp txt file
Hi,
The code below is not recording when users enter a spreadsheet, simply when they leave it.
Can anyone see why that is?
Thanks
Seamus
The code below is not recording when users enter a spreadsheet, simply when they leave it.
Can anyone see why that is?
Thanks
Seamus
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Debug.Print "closed"
MyFile = "C:\Documents and Settings\travseam\Desktop\temp.txt"
'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
Print #fnum, Environ("USERNAME") & " left at " & Now()
Write #fnum,
Close #fnum
End Sub
Private Sub Workbook_Open()
Debug.Print "open"
MyFile = "C:\Documents and Settings\travseam\Desktop\temp.txt"
'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
Print #fnum, Environ("USERNAME") & " entered at " & Now()
Write #fnum,
Close #fnum
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER