+ Reply to Thread
Results 1 to 10 of 10

Creating a backup protected with pw

  1. #1
    Registered User
    Join Date
    12-16-2014
    Location
    Czech
    MS-Off Ver
    2010
    Posts
    18

    Creating a backup protected with pw

    Hello,

    I want to create a backup excel workbook encrypted with password whenever I hit a button save.

    So far I have this but still canīt figure out how to protect all new .xlsm files with password so noone canīt do a change in backup files without knowing a password. Saving and creating backup files in different folder works.

    Thanks.

    Please Login or Register  to view this content.
    Last edited by pandemic; 02-09-2015 at 09:52 AM.

  2. #2
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Creating a backup protected with pw

    I don't think there is a way to add a password with savecopyas, you'd need saveas for that
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  3. #3
    Registered User
    Join Date
    12-16-2014
    Location
    Czech
    MS-Off Ver
    2010
    Posts
    18

    Re: Creating a backup protected with pw

    Can you please help me to modify my code with Saveas function? Im not sure how to do it with such a complex (for me) needs - date, time and computer name in filename. Thank you for efforts.

  4. #4
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Creating a backup protected with pw

    All you need to change is the save command:

    replace:
    Please Login or Register  to view this content.
    with:
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    12-16-2014
    Location
    Czech
    MS-Off Ver
    2010
    Posts
    18

    Re: Creating a backup protected with pw

    Hello Arkadi,

    Thanks for your solution but it doesnīt work for me. Kindly see an attachement, it does not dissapear when I hit Yes, No even Cancel

    Had to force quit via task manager.
    aaa.png
    My current code is below

    Please Login or Register  to view this content.
    Attached Images Attached Images
    Last edited by pandemic; 02-10-2015 at 01:57 PM.

  6. #6
    Registered User
    Join Date
    12-16-2014
    Location
    Czech
    MS-Off Ver
    2010
    Posts
    18

    Re: Creating a backup protected with pw

    I have form which gives me the correct path to dropbox folder depending on which computer is using this workbook.
    Variable DestinationFolder is defined in modules like this "Global DestinationFolder As String"

    Please Login or Register  to view this content.

  7. #7
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Creating a backup protected with pw

    I meant to ask... why is the macro in the workbook_beforesave event?

    It is causing problems that way I believe, but I don't know your entire macro routine. The change I suggested also makes the saved workbook the current one at the same time, I think it is getting stuck in a loop. Can this not just be a normal macro you call from somewhere? Then it should work.

  8. #8
    Registered User
    Join Date
    12-16-2014
    Location
    Czech
    MS-Off Ver
    2010
    Posts
    18

    Re: Creating a backup protected with pw

    I want to create a whole new protected copy of current workbook in different folder. "SaveAs" is just saving a workbook in specified destination, I believe.


    "Private Sub Workbook_AfterSave" provides that this macro will run after hitting a save button.

    Do you think, there is a way how to do it? To sum it up:

    Create a new copy of protected workbook in specified destination with specified name (date, time, name of computer)

  9. #9
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Creating a backup protected with pw

    Yes we can do it. aftersave is an event. It takes place after saving, so I think we just need to change the structure a bit. Quite busy at work today, so I probably won't get back to you until tomorrow, hopefully with some code

  10. #10
    Registered User
    Join Date
    12-16-2014
    Location
    Czech
    MS-Off Ver
    2010
    Posts
    18

    Re: Creating a backup protected with pw

    Hello Arkadi,
    just reminding myself about my issue. Was trying to write some code myself but it ended with horrible crash.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Excel is creating .xlsm backup automatically--why?
    By alansidman in forum Excel General
    Replies: 0
    Last Post: 06-02-2011, 10:13 PM
  2. Creating Backup file! (Not Save-as)
    By Rick_Stanich in forum Excel General
    Replies: 1
    Last Post: 11-24-2009, 06:34 PM
  3. Creating Backup
    By Brian L Matlack in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-04-2008, 01:50 PM
  4. Creating a backup of Excel Workbooks
    By BigBas in forum Excel General
    Replies: 1
    Last Post: 10-10-2007, 11:43 AM
  5. [SOLVED] Creating a Backup copy of workbook
    By justaguyfromky in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-03-2006, 07:10 PM

Tags for this Thread

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