+ Reply to Thread
Results 1 to 8 of 8

protect/unprotect a VBA Project

  1. #1
    Forum Contributor
    Join Date
    03-09-2004
    Posts
    140

    Remove protection from a protected VBA project

    Hi all
    Is there a way to:

    unprotect a VBA project using code?

    protect/unprotect a VBA Project using macro?
    Last edited by helmekki; 05-25-2005 at 01:15 PM.
    Yours
    hesham Almakki
    http://www.almakki.com.ly/

  2. #2
    Forum Contributor
    Join Date
    06-10-2004
    Location
    India
    Posts
    1,066
    something like this:


    Sub ProtectSht(sht)
    sht.Protect Password:=pwd, DrawingObjects:=True, contents:=True, Scenarios:=True
    End Sub


    Sub UnprotectSht(sht)
    sht.Unprotect Password:=pwd
    End Sub


    Mangesh

  3. #3
    Forum Contributor
    Join Date
    03-09-2004
    Posts
    140
    Thank u 4 your reply

    i ment is there a vba code to remove protection from the protected vba project ?

    sometimes vba projects are protected, so i am lookinf for a code to remove protection from the protected vba project ........

    the code to remove protection might be placed in a workbook and be used to remove protection from a protected vba project that exists in a different workbook.

  4. #4
    Forum Contributor
    Join Date
    03-09-2004
    Posts
    140
    any idea yet ????

  5. #5
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Smile

    Good evening Helmekki

    We are all pretty much aware that the protection for worksheets and structure is a little bit flimsy (to say the least!). However, the routines used to protect VBA routines and password protected files is a little bit more robust - but that is not to say it cannot be cracked, just not by a macro. If you need to open a password protected project you can buy specialist software to do so, or pay a service where you e-mail your file to a company and get it back several hours later unprotected.

    It can be done using a hex editor, and if your file is not highly confidential I would be prepared to remove the password for you. No charge.

    But it CANNOT be done from within Excel.

    HTH

    DominicB

  6. #6
    Forum Contributor
    Join Date
    03-09-2004
    Posts
    140
    Ok dominicb, Thank u very much

    I uploaded the addin that i would like to remove the password from the protected project.

    pls see the attached addin.

    Thank u
    Attached Files Attached Files

  7. #7
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Smile

    Hi Hesham

    Slight problem in that the program is not a VBA program, but has been written using VB (similar, but different). VB allows for standalone applications to be written and compiled modules to be used as excel add-ins, and compiled modules will look like mumbo jumbo (if you're not English you won't understand this term, but it means muddled up and confused!) and would not make sense.

    So how can you tell if an add-in is compiled VB or standard VBA (which is compiled at run time)? Well, if you are prompted for a password, it is VBA. If the message is "This project is unviewable" it is compiled code. However, if you want to know how the program does what it does, have a quick look here for VBA code to do what this add-in does, and a bit of interesting information about how the password crackers work.

    http://www.mcgimpsey.com/excel/removepwords.html

    HTH

    DominicB

  8. #8
    Forum Contributor
    Join Date
    03-09-2004
    Posts
    140

    Thumbs up

    Thank u very much dominicb

+ Reply to 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