+ Reply to Thread
Results 1 to 5 of 5

Save and Print Button without duplicates and security password predefined.

  1. #1
    Registered User
    Join Date
    07-02-2014
    Location
    El Salvador
    MS-Off Ver
    Ms Office 2010
    Posts
    5

    Lightbulb Save and Print Button without duplicates and security password predefined.

    Hi ... I'm pretty new here, and I do hope and doing this in the right way, so, here goes my problem:

    I want to insert a button in one of my files, which is sort of a protocol that I have to keep tracking for tracebility purposes. I would like this button to save a copy of this document with an unique name, which is in one of the cells of the workbook, and at the same time, print out a copy of the whole sheet in which that cell is. I've seen this thread: http://www.excelforum.com/excel-prog...ne-button.html, but it doesn't fully gives me what I need.

    Trying to narrow it all: I need to program a button that once clicked, saves the file in a predetermined folder in my desktop, with an unique file name that should be composed of the content on one cell(say, "M-123456") plus another cell ("0001"), so, at the end, the saved file name should be: "M-123456 0001.xls". It should not create duplicates, or alert me if I tried to do it. Once this file is generated, it should have a predefined password (so it's the same for all the files generated from this original file) and inmediatly print the sheet this button is in.

    Could it be possible? Am I dreaming or could it be done? I've tried a couple of things myself, but I've noticed that I failed miserably at it

    I do thank you for your time

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

    Re: Save and Print Button without duplicates and security password predefined.

    Do you have a workbook or existing code to share?

    In any case, add this code to a module in the workbook, and then assign the macro to a button you insert on the sheet. Please note that cells B1 and B2 on "Sheet2" are where the code gets the file name parts from, but you can easily change the code to suit. I made the file extension xlsm instead of xls because that is a macro-enabled workbook which you need if you want a macro in it. Hope it helps

    p.s. this code will give you an error if the folder does not exist, you can probably find code to make the folder if needed, but I wasn't sure how you want to handle that, and assume you will create the folder to save backups in.

    Please Login or Register  to view this content.
    Last edited by Arkadi; 07-07-2014 at 02:56 PM.
    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
    07-02-2014
    Location
    El Salvador
    MS-Off Ver
    Ms Office 2010
    Posts
    5

    Re: Save and Print Button without duplicates and security password predefined.

    It does help :D! Thanks, Arkadi! Btw, could I ask one more thing? Besides requesting a password to access the file, could it be possible to ask for another password for the editing of such file? Thanks again :D

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

    Re: Save and Print Button without duplicates and security password predefined.

    Sure, here is the updated code: I made the second password "second" but it could be the same as the first if you want....

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    07-02-2014
    Location
    El Salvador
    MS-Off Ver
    Ms Office 2010
    Posts
    5

    Re: Save and Print Button without duplicates and security password predefined.

    This was awesome, Arkadi, thanks for your help! Case Closed for me :D!

+ 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. Macro Button to Save as Read Only + Password
    By Hirani in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-19-2010, 12:47 PM
  2. Replies: 0
    Last Post: 09-06-2005, 12:05 PM
  3. Replies: 0
    Last Post: 09-06-2005, 12:05 AM
  4. Replies: 1
    Last Post: 06-23-2005, 08:05 PM
  5. Replies: 0
    Last Post: 06-23-2005, 07:05 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