+ Reply to Thread
Results 1 to 5 of 5

Password and Macro

  1. #1
    Registered User
    Join Date
    05-28-2009
    Location
    Oakville, ON Canada
    MS-Off Ver
    Excel 2002
    Posts
    75

    Password and Macro

    I have an excel spreadsheet that has password to open it as well a read only prompt. What I would like to happen is after the user has typed in the password, clicked ok, and then clicked either "yes" or "no" for read only or not that a specific named macro immediately is run.

    How do I do that?
    Last edited by Foxcan; 09-30-2009 at 03:06 PM.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Password and Macro

    You can invoke the procedure from the Workbook_Open event, provided the user has enabled macros.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    05-28-2009
    Location
    Oakville, ON Canada
    MS-Off Ver
    Excel 2002
    Posts
    75

    Re: Password and Macro

    I am a novice using macros. Can you help me with the actual code? Thanks

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Password and Macro

    In the VBE, select the ThisWorkbook module. In the code window, select Workbook from the left dropdown, and this code will appear:

    Please Login or Register  to view this content.
    Call your macro from there.

  5. #5
    Registered User
    Join Date
    05-28-2009
    Location
    Oakville, ON Canada
    MS-Off Ver
    Excel 2002
    Posts
    75

    Re: Password and Macro

    Thank you very much!

+ 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