+ Reply to Thread
Results 1 to 5 of 5

Macro Running Userform for Username/Password

  1. #1
    Registered User
    Join Date
    01-02-2013
    Location
    Houston,Texas
    MS-Off Ver
    Office 2010
    Posts
    3

    Macro Running Userform for Username/Password

    Hey guys, I'm new to the forum and after hours of banging my head on my desk I decided I needed help badly.

    I have a Macro Template that I want to protect the Headers and footers. I set the macro to allow access to the headers and footers if the Template had a specific name and that works great. I began writing a code that if the specified name of the document was not used then a username and password prompt would run to access the header and footer. it works great until you start moving around in the headers and footers (moving the cursor left, right, down, up etc) to edit. Every time I move the cursor I receive the Password Userform, can anyone help me with just making the Password Prompt pop up only once after entering the header or footer and then resetting after exiting?

    Document code:

    Please Login or Register  to view this content.
    Password Userform:
    Please Login or Register  to view this content.

  2. #2
    Valued Forum Contributor
    Join Date
    11-02-2012
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    564

    Re: Macro Running Userform for Username/Password

    This is because you used 'WindowSelectionChange' event to run macro. This event would be activated whenever you change the selection and macro will be run. Try using other event based on your needs like 'WindowActivate Event'

  3. #3
    Registered User
    Join Date
    01-02-2013
    Location
    Houston,Texas
    MS-Off Ver
    Office 2010
    Posts
    3

    Re: Macro Running Userform for Username/Password

    How would I write that?

  4. #4
    Valued Forum Contributor
    Join Date
    11-02-2012
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    564

    Re: Macro Running Userform for Username/Password

    Can you upload your document?

  5. #5
    Registered User
    Join Date
    01-02-2013
    Location
    Houston,Texas
    MS-Off Ver
    Office 2010
    Posts
    3

    Re: Macro Running Userform for Username/Password

    Here's a link to it:http://file.ac/SNmmNz-1g_E/

+ 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