I have excel file(excel 2003). I want to log the information that record username opening my file and the text is edited.


I search some codes in internet and i got this code...
........................................................................................
Sub LogInformation(LogMessage As String)
Const LogFileName As String = "C:\FOLDERNAME\TEXTFILE.LOG"
Dim FileNum As Integer
FileNum = FreeFile ' next file number
Open LogFileName For Append As #FileNum ' creates the file if it doesn't exist
Print #FileNum, LogMessage ' write information at the end of the text file
Close #FileNum ' close the file
End Sub
.................................................................................
Now, i have a problem when i execute this code. It does not work...
Anyone can comment this code?
I am just new in VBA codes....
Please help me...

Thank you
Akou