+ Reply to Thread
Results 1 to 13 of 13

Weird Passwords

  1. #1
    Registered User
    Join Date
    05-25-2010
    Location
    Lincoln, Maine
    MS-Off Ver
    Excel 2002
    Posts
    9

    Weird Passwords

    Hello All,

    I have been working on a project and leaning VBA. I have writing a program that protects and un-protects the sheet as needed. I have designated a password in the programing. However, whenever I run my excel workbook it seems to have a mind of its own. When I go to unlock the spreadsheet it asks for a password. The password is not one that I have designated, in fact, it is completely random. Using a VBA macro "hack" I am able to run the macro to figure out what it is so I can get to my document. The passwords I have found so far have been:

    AAAAAAAABABF
    AABABBABAAAL

    I have no idea as to why excel is assigning random passwords. I can post my programming if people think it would help explain this issue.

    Thanks!

  2. #2
    Forum Contributor
    Join Date
    12-03-2009
    Location
    Providence RI
    MS-Off Ver
    Excel 2007, Excel 2010
    Posts
    260

    Re: Weird Passwords

    Just as a FYI, that password is not nessecarrily the password it set. While we shouldn't discuss breaking passwords here, just trust me in that fact. Please post your code so that we can determine where the issue is.

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Weird Passwords

    Excel will not assign random passwords,there must be something within your code that is wrong.maybe your code that re-sets the password contains a typo. Remember it could be a case issue.

    It's best todeclare the password asaconstant
    Please Login or Register  to view this content.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  4. #4
    Registered User
    Join Date
    05-25-2010
    Location
    Lincoln, Maine
    MS-Off Ver
    Excel 2002
    Posts
    9

    Re: Weird Passwords

    Sorry for the confusion all,

    Please Login or Register  to view this content.

  5. #5
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Weird Passwords

    Edit the original post don't just post again

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

    Re: Weird Passwords

    As a general comment, you should put Option Explicit as the first line in every module, and then declare variables appropriate to usage until your project compiles.

    With Password declared in the Workbook_Open event, it is out of scope and (sans Option Explicit) recreated on the fly each other place it is referenced.

    It should be declared as a public constant in a CODE module.
    Entia non sunt multiplicanda sine necessitate

  7. #7
    Registered User
    Join Date
    05-25-2010
    Location
    Lincoln, Maine
    MS-Off Ver
    Excel 2002
    Posts
    9

    Re: Weird Passwords

    Shg,

    I may not totaly understand what your saying, but I wanted to let you know that this exists in the This Worksheet project under the Microsoft Excel Objects folder. Therefore, this starts on opening this workbook

    Thank you for your help so far.

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

    Re: Weird Passwords

    Is the password used in any other code in the workbook?

  9. #9
    Registered User
    Join Date
    05-25-2010
    Location
    Lincoln, Maine
    MS-Off Ver
    Excel 2002
    Posts
    9

    Re: Weird Passwords

    No, it only exists in the code I sent you.

  10. #10
    Valued Forum Contributor mdbct's Avatar
    Join Date
    11-11-2005
    Location
    CT
    MS-Off Ver
    2003 & 2007
    Posts
    848

    Re: Weird Passwords

    Quote Originally Posted by ExcelNut View Post
    Hello All,

    The passwords I have found so far have been:

    AAAAAAAABABF
    AABABBABAAAL

    I have no idea as to why excel is assigning random passwords. I can post my programming if people think it would help explain this issue.

    Thanks!
    If it's the macro/hack I think it is, the message box says something along the lines of:
    A password that will unlock the work book is: AAAAAAAABABF

    It didn't specify the actual password, it supplied a string of characters that would unlock the workbook.

    Excel's password protection of workbooks was not, and still may not be, very secure.

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

    Re: Weird Passwords

    I would structure the code more like this. Note the first line:
    Please Login or Register  to view this content.

  12. #12
    Registered User
    Join Date
    05-25-2010
    Location
    Lincoln, Maine
    MS-Off Ver
    Excel 2002
    Posts
    9

    Re: Weird Passwords

    Shg,

    Thank you for the clean code. I have made a few changes to it. Here it is:


    Please Login or Register  to view this content.
    The date will not change on the sheet. I will have to explore the reason to this soon. Any thoughts? Also, is it possible to not have Excel ask for a password on opening up the worksheet even though it is protected?

    Many thanks! The option explicit line seemed to clean up/ take care of my password issue!

  13. #13
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Weird Passwords

    Hello ExcelNut,

    Just so everyone is on the same page, we do not discuss nor provide solutions that will defeat, bypass, or disable security measures of any kind. I agree with mdbct about the code you sited for "weird" passwords. No further explanations or discussions will made on this code or how it works. Please be careful what you ask about. Violating this rule will result in the post be closed and deleted.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

+ 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