+ Reply to Thread
Results 1 to 6 of 6

How to protect a file of Excel-Macro enabled workbook with password?

  1. #1
    Forum Contributor PRADEEPB270's Avatar
    Join Date
    02-19-2010
    Location
    INDIA
    MS-Off Ver
    MSoffice-2016
    Posts
    332

    How to protect a file of Excel-Macro enabled workbook with password?

    I want to protect a file having enabled VBA codes and a Macro with the password as we easily do in excel files.
    When it protect by password then macro or VBA do not work.
    Is it possible to provide the password in excel-macro enabled workbook realted file having macro or vba codes?How?
    Regards


    Pradeep Kumar Gupta
    Gurgaon ( INDIA )

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: How to protect a file of Excel-Macro enabled workbook with password?

    I believe you are talking about sheet protection, please confirm whether my assumption is right?

    If so, apply protection via coding

    Please Login or Register  to view this content.
    Because in manual protection you don’t have the option to set the UserInterfaceOnly to True. UserInterfaceOnly will allow the codes to run but don’t allow the manual access to the sheet.


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: How to protect a file of Excel-Macro enabled workbook with password?

    Hi, PRADEEPB270,

    in addition: the mentioned code line is volatile (not saved with the workbook) and would need to be used on every opening of the file (IŽd recommend to apply it on Activating the workbook as well).

    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  4. #4
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: How to protect a file of Excel-Macro enabled workbook with password?

    Quote Originally Posted by HaHoBe View Post
    in addition: the mentioned code line is volatile (not saved with the workbook) and would need to be used on every opening of the file
    Wow Really I am not aware of it Nice Tip

  5. #5
    Forum Contributor PRADEEPB270's Avatar
    Join Date
    02-19-2010
    Location
    INDIA
    MS-Off Ver
    MSoffice-2016
    Posts
    332

    Re: How to protect a file of Excel-Macro enabled workbook with password?

    Please refer to attach file (PKG) of excel-macro enabled .Can you protect this file with the password-"PKG1970"?
    Means everytime,when I open the file,it should ask the password as in excel practice.But we sure,that all the macro or VBA codes work perfect after given password.
    For an example,double click the cell no B9,then Sheet 5 should be open.
    Attached Files Attached Files

  6. #6
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: How to protect a file of Excel-Macro enabled workbook with password?

    Hi, PRADEEPB270,

    you should amend your cod ein ThisWorkbook with the code to hide the sheet when leaving (all worksheets except Summary):
    Please Login or Register  to view this content.
    Ciao,
    Holger
    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. Replies: 0
    Last Post: 03-12-2013, 02:33 AM
  2. Trying to build Macro to password protect all sheets in workbook
    By eatmorecheese in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-11-2012, 12:07 PM
  3. [SOLVED] Password protect an excel file?
    By in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-28-2009, 10:53 AM
  4. Password protect a workbook created and emailed by a macro?
    By isewdollies in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-10-2006, 03:50 AM
  5. macro to password protect exel file
    By anelh6 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-24-2005, 09:05 PM

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