View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
GB[_3_] GB[_3_] is offline
external usenet poster
 
Posts: 70
Default protecting a csv file

"lothario" wrote in message
...

Hi,


I would like to ensure that after the file is saved,
the attributes of the file are changed such that:

1. It becomes READ-ONLY.
2. It cannot be deleted.

Please show me the VBA code that I can incorporate to the above to
accomplish this.

Thanks,
Luther


Does this help?

This example uses the SetAttr statement to set attributes for a file.

SetAttr "TESTFILE", vbHidden ' Set hidden attribute.
SetAttr "TESTFILE", vbHidden + vbReadOnly ' Set hidden and read-only
' attributes.