How to hide a text file using macro

S

shirley_kee

I've created a log file in text format when excel file is opened. The
text file contains directory of excel that I've opened and user name. I
want the text file to be hidden in order to prevent user from seeing it

Does anybody has any idea how to do it in Macro??
 
Z

Zygan

Unfortunately i dont know how to hide them but i figure you want to hide
it on a user drive so that when they open a file it can source back to
the "hidden" file and update the file. i know that you can set up a
macro to create the file and save it with a password and you can set
the password to equal what ever you like e.g
Sub Macro1()
Password = "MYPASSWORD"
ChDir "C:\...."
ActiveWorkbook.SaveAs Filename:= _
"C:\...\Book1.xls", FileFormat:= _
xlNormal, Password:="" + password + "", WriteResPassword:="" +
password + "", _
ReadOnlyRecommended:=False, CreateBackup:=False
End Sub


Give that a shot.

If you ever find out how to hide a file with a macro post it please.

Thanks
 
Top