Write protecting a text file created in VBA RRS feed

  • Question

  • I have a text file which is created using VBA in Access. I want the user to be able to access the file to upload it to our bank, but I don't want them to be able to edit the file using notepad or similar text editors. Has anyone solved this problem using VBA?



    Thursday, July 19, 2018 3:50 PM

All replies

  • I would suggest using a password protected zip file.  Windows doesn't come with zip.  I would look at using DotNetZip.  It has a COM interface and can password protect a file. 
    Friday, July 20, 2018 6:45 PM
  • ANYTHING you allow someone to see can be copied and ultimately edited.

    Furthermore you cannot force anyone to run macros - that would be an open door for malicious code writers.

    Graham Mayor - Word MVP

    Tuesday, July 24, 2018 11:48 AM
  • This isn't a fool proof solution like a password protected zip file but you could calculate a checksum for the text and append it to the file.  When you receive file check the checksum and you'll know if it has been edited. 
    Tuesday, July 24, 2018 12:43 PM