Closed Thread
Results 1 to 4 of 4

Setting Password & WriteResPassword

  1. #1
    Kevin H. Stecyk
    Guest

    Setting Password & WriteResPassword

    Setting Password & WriteResPassword

    Once I have opened a workbook that is Password protected and
    WriteResPassword protected, how do I then save the workbook with a new
    Password and WriteResPassword?

    I know to open a workbook it is simply:

    Workbooks.Open Filename:="MyBook.xls", Password:="TopSecret1",
    WriteResPassword:="TopSecret2"

    I thought Workbooks("MyBook.xls").Close would have the same properties. But
    it doesn't.

    Any guidance is appreciated.

    Regards,
    Kevin



  2. #2
    Kevin H. Stecyk
    Guest

    Re: Setting Password & WriteResPassword

    Kevin H. Stecyk...
    > Setting Password & WriteResPassword
    >
    > Once I have opened a workbook that is Password protected and
    > WriteResPassword protected, how do I then save the workbook with a new
    > Password and WriteResPassword?
    >
    > I know to open a workbook it is simply:
    >
    > Workbooks.Open Filename:="MyBook.xls", Password:="TopSecret1",
    > WriteResPassword:="TopSecret2"
    >
    > I thought Workbooks("MyBook.xls").Close would have the same properties.
    > But it doesn't.
    >
    > Any guidance is appreciated.
    >
    > Regards,
    > Kevin



    ActiveWorkbook.SaveAs Filename:= _
    "C:\Documents and Settings\Junk\DeleteBook.xls", FileFormat _
    :=xlNormal, Password:="delete", WriteResPassword:="delete", _
    ReadOnlyRecommended:=True, CreateBackup:=False



  3. #3
    Registered User
    Join Date
    05-31-2012
    Location
    Groenlo, Netherlands
    MS-Off Ver
    Excel 2019
    Posts
    63

    Re: Setting Password & WriteResPassword

    Bit of an old thread, but my question is pretty much related.

    I managed to add password protection to my excel file with VBA, using the following code:
    Please Login or Register  to view this content.
    How to remove the passwords with VBA?
    I do still have the passwords and can open my file, but somehow using ThisWorkbook.SaveAs password:="", writeResPassword:="" doesn't work.

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,853

    Re: Setting Password & WriteResPassword

    Administrative Note:

    We are happy to help, however whilst you feel your request is similar to this thread, experience has shown that things soon get confusing when answers refer to particular cells/ranges/sheets which are unique to your post and not relevant to the original.

    Please see Forum Rule #4 about hijacking and start a new thread for your query.

    If you are not familiar with how to start a new thread see the FAQ: How to start a new thread
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1