+ Reply to Thread
Results 1 to 14 of 14

EXCEL: RunTime UnProtect VBA Project Password

  1. #1
    Forum Contributor
    Join Date
    12-28-2012
    Location
    Mumbai - India
    MS-Off Ver
    Excel
    Posts
    145

    EXCEL: RunTime UnProtect VBA Project Password

    Dear All

    I' am using a Code which is not executed on a Protected VBA Project.

    VBA Project Password is - "XYZ"

    Hence, I' want a Code for UnProtecting VBA Project which I' can Run before my Code.

    Thanks
    MG

  2. #2
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: EXCEL: RunTime UnProtect VBA Project Password

    the only options I have ever seen are http://www.vbaexpress.com/forum/showthread.php?t=43809
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  3. #3
    Forum Contributor
    Join Date
    12-28-2012
    Location
    Mumbai - India
    MS-Off Ver
    Excel
    Posts
    145

    Re: EXCEL: RunTime UnProtect VBA Project Password

    Thanks JosephP for reply

    I' have seen your link, but there are many codes and I' am not sure which code to be use.

    Could you please do a favor by putting the code here mentioning the way I' use it in my File

    That will be really appr

  4. #4
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: EXCEL: RunTime UnProtect VBA Project Password

    the code in post #16 in the link

  5. #5
    Forum Contributor
    Join Date
    12-28-2012
    Location
    Mumbai - India
    MS-Off Ver
    Excel
    Posts
    145

    Re: EXCEL: RunTime UnProtect VBA Project Password

    Ok

    Do I' need to put my given password in the code?

    If yes? where..

    and where should I' put this code in my file?

    module or before my code.

  6. #6
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: EXCEL: RunTime UnProtect VBA Project Password

    yes-in the routine at the bottom that unlocks the project (I think it says "myPassword")

    put it in a separate module

  7. #7
    Forum Contributor
    Join Date
    12-28-2012
    Location
    Mumbai - India
    MS-Off Ver
    Excel
    Posts
    145

    Re: EXCEL: RunTime UnProtect VBA Project Password

    Thanks it working

    But !!!!

    I' am getting error message - "Programmatic access to Visual Basic Project is not trusted"

    If I' tick the same in Excel option, no error is displayed and working fine

    But how can I' force user to activate the same, because there are chances that user will keep this disabled

    Could you please give me any suggestion for the same?

    Thanks
    MG

  8. #8
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: EXCEL: RunTime UnProtect VBA Project Password

    you will have to give them a message to enable that setting

  9. #9
    Forum Contributor
    Join Date
    12-28-2012
    Location
    Mumbai - India
    MS-Off Ver
    Excel
    Posts
    145

    Re: EXCEL: RunTime UnProtect VBA Project Password

    Are you saying that I' suppose to provide a instruction document

    OR

    Should I' mention the message in the Code itself - if yes? How?

    Sorry for asking dumb things

  10. #10
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: EXCEL: RunTime UnProtect VBA Project Password

    whichever you prefer. you can use a msgbox statement in the code or create a userform or use a worksheet with instructions on

  11. #11
    Forum Contributor
    Join Date
    12-28-2012
    Location
    Mumbai - India
    MS-Off Ver
    Excel
    Posts
    145

    Re: EXCEL: RunTime UnProtect VBA Project Password

    Hey Joseph

    Everything is working fine But....., with this code VBE is getting opened.

    what to do for that.... I' don't want the VBA Code remain open after running the Code

  12. #12
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: EXCEL: RunTime UnProtect VBA Project Password

    do you mean you want the vbe closed? how do you know the user didn't already have it open?

  13. #13
    Forum Contributor
    Join Date
    12-28-2012
    Location
    Mumbai - India
    MS-Off Ver
    Excel
    Posts
    145

    Re: EXCEL: RunTime UnProtect VBA Project Password

    Even they have open it, VBE should be closed after running our Code.

    Anyways in my case no one will open VBE, as the users are not that much capable.

    But they can take objection that after some xyz process VBE window is opened.

    Please help me with it.

  14. #14
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: EXCEL: RunTime UnProtect VBA Project Password

    Please Login or Register  to view this content.
    oughta do it

+ 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