Results 1 to 4 of 4
  1. #1
    New Lounger
    Join Date
    May 2003
    Location
    Detroit, Michigan, USA
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Password Protect Files (OFFICE 2000)

    I have an ACCESS 2000 app that I use to create multiple Excel files. I'd like to password protect these files so that a user is prompted for the password when they open the files. This is normally done via the File, Save As dialog, under the Tools, General Options area.

    Is there a way to call this dialog via VBA code, so that I can programmatically assign the passwords to the files?

    Thanks!

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Password Protect Files (OFFICE 2000)

    Yes, that is possible, but can you tell us how you create the Excel workbooks from your Access app?

  3. #3
    New Lounger
    Join Date
    May 2003
    Location
    Detroit, Michigan, USA
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Password Protect Files (OFFICE 2000)

    Hi Hans -
    Basically, I have a recordset that I break apart based on one of the fields, assign a file name, then use the TransferSpreadsheet function to export the files to a staged directory. Code is attached.

    Thanks,
    Mike

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Password Protect Files (OFFICE 2000)

    You can use Automation to open the workbook in Excel, set the password and close it. See attached version of your code. I have indicated the changes with comments.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •