+ Reply to Thread
Results 1 to 4 of 4

VBA to Lock and prevent opening of the excel file

  1. #1
    Registered User
    Join Date
    04-23-2015
    Location
    Denver, Co
    MS-Off Ver
    Excel 2013
    Posts
    56

    VBA to Lock and prevent opening of the excel file

    Hello, I hope all is well. I’m trying to write a code that I can add to the macros I have created so that after a certain date the workbook saves and enters a password that will prevent the workbook from opening. I have come up with the code below but can’t seem to get it to work. Any help is appreciated.
    Please Login or Register  to view this content.

  2. #2
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: VBA to Lock and prevent opening of the excel file

    Hello Excelguruintraining,

    You could try the Code below:

    Please Login or Register  to view this content.
    Regards.
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  3. #3
    Registered User
    Join Date
    04-23-2015
    Location
    Denver, Co
    MS-Off Ver
    Excel 2013
    Posts
    56

    Re: VBA to Lock and prevent opening of the excel file

    Thank you Winon for the response however, this code does not lock the spreadsheet and prevent it from opening without entering the password.

  4. #4
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: VBA to Lock and prevent opening of the excel file

    Hello Excelguruintraining,

    Thank you for your response. I must add, that I was a bit uncertain as to what exactly you wanted, and it would seem to me that there just might be a little bit more to what your original post states.

    May I suggest for a start, we have a look at the attached sample Workbook, and see if it is closer to your requirement?

    Hope it helps!

    Regards.
    Attached Files Attached Files

+ 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. [SOLVED] Upon opening file i get an excel alert message. How to prevent this?
    By welchs101 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-24-2014, 09:11 AM
  2. Prevent recalculation when opening .csv file
    By duffry in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-05-2014, 09:20 AM
  3. Prevent other user opening excel file.
    By ebin charles in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-08-2014, 02:13 PM
  4. How to prevent opening a blank excel file
    By st24961 in forum Excel General
    Replies: 1
    Last Post: 05-09-2007, 10:22 PM
  5. [SOLVED] Prevent Excel from going online when opening html file
    By G.Mueller in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-25-2006, 03:30 AM

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