Hey, I have a spreadsheet that populates word documents and I like to keep a log of when it is being used, here is the macro I used to use...
'Update the log file
Dim Fnum As Integer
Fnum = FreeFile
Open ThisWorkbook.Path & "\Templates\log.txt" For Append As #Fnum
Print #Fnum, Environ("username"), Format(Now, "dd-mmm-yyy hh:mm"), Fnamer$
Close #Fnum
Now this worked just fine, but a few users did not have write access to the folder so it caused an error and quit out. Is there a way it can check to see if writing to the file is possible, and only create a log entry if it is?
Any help appreciated!
Bookmarks