将此段代码COPY到你的XLS文件VBA界面里去,用户打开文件时会自动生成一个TEST.TXT的LOG文件,记录打开时间,用户名,电脑名。也可以把TEST.TXT改成TEST.DAT,以欺骗普通用户。写的DAT文件,用记录本方式打开就可以直接看到。Private Sub Workbook_Open()
Dim FN As String
Dim ITF As Integer
Dim Str As String
Str = "User:" & Environ("UserName") & " Computer:" & Environ("COMPUTERNAME") & " Open Time:" & Now