+ Reply to Thread
Results 1 to 36 of 36

ByPassing Passwords when pulling stats from external password-protected files

  1. #1
    Registered User
    Join Date
    05-24-2010
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    24

    ByPassing Passwords when pulling stats from external password-protected files

    okay, brand new here... i just can't wrap my head around my problem; super hopeful that somebody can help me out here...

    I have used excel to create a stat monitoring system to our work's employees. They enter their stats for the week, and I tablulate their stats for the manager's to review. There's only 50 employees in our non-profit organization. All of these stat files work perfectly.

    So, now I'm at the point where I'm trying to create a manager file to review the performance stats of our employees. I'm trying to create a system that doesn't insist that each manager type in 50 passwords whenever they wanted an update on stats.

    So, I have two worksheets.

    One worksheet, called 'Passwords', shows the external file name [firstname_lastname_stats.xls] in A1 and their password in B1. This goes to A50 and B50 respectively. I have all of the external stat file names and their respective passwords in this file.

    The other worksheet just pulls various stat totals already calculated from the external file.

    How can I set this up so the manager doesn't have to type in all of these passwords? Any ideas? Thanks very much!
    Last edited by jameztown; 05-27-2010 at 02:37 PM.

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

    Re: ByPassing Passwords when pulling stats from external password-protected files

    What have you got so far?

    To best describe or illustrate your problem you would be better off attaching a dummy workbook, the workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    If needed supply a before and after sheet in the workbook so the person helping you can see what you are trying to achieve.

    Doing this will ensure you get the result you need!
    Hope that helps.

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

    Free DataBaseForm example

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

    Re: ByPassing Passwords when pulling stats from external password-protected files

    Hello jameztown,

    Welcome to the Forum!

    You will need a VBA macro to open the workbooks since they are password protected. It isn't clear from your post if you have any formulas or VBA code already in place or you need all help constructing these. If you have a workbook, it would help if you posted it.
    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!)

  4. #4
    Registered User
    Join Date
    05-24-2010
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    24

    Re: ByPassing Passwords when pulling stats from external password-protected files

    thanks... I didn't realize I could upload my workbook. I've made a similar file, taking out some names.

    I currently don't have any VBA on the file; although I try to attempt to code this out. I've deleted that avoid any confusion.

    Basically, I just need the code that will bypass the request that asks for each employees password.

    Thanks so much for your help!
    Last edited by jameztown; 05-27-2010 at 12:55 PM.

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

    Re: ByPassing Passwords when pulling stats from external password-protected files

    Hello jameztown,

    The attached workbook is fully automated. The workbook names are built from the names on the active sheet in column "A". Each workbook is opened and the summary information is copied from the workbook to the active sheet columns "C:Q".

    I added a button on the worksheet to run the macro. If you have a lot of sheets, you may want to add a shortcut key to the macro rather than adding buttons and assigning the macro to each button on each sheet. Here is the macro code.
    Please Login or Register  to view this content.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    05-24-2010
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    24

    Re: ByPassing Passwords when pulling stats from external password-protected files

    Wow... thanks for your help thus far; i've spent about 6 hours on this trying to make it work! you are incredibly helpful; i can't even tell you...

    i get an error message when pressing the update button. it can't find my external worksheets. it's looking for the correct file [firstname_lastname_stats.xls] but it's giving me a run time error [1004]. I've tried moving this file around, wondering if it's reaching for the files in a subfolder; but, still can't get it to work. Any ideas?

    Right now, it should be looking in the same folder. I've placed summary.xls right next to all of the firstname_lastname_stats.xls files.
    Last edited by jameztown; 05-24-2010 at 09:01 PM.

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

    Re: ByPassing Passwords when pulling stats from external password-protected files

    Hello jameztown,

    Can you tell me the error number? In the macro it is looking for the worksheet "Summary" in the workbooks being opened. Are you using a different name? If so, you will need to change the name in the macro to match the worksheet name you are using.

  8. #8
    Registered User
    Join Date
    05-24-2010
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    24

    Re: ByPassing Passwords when pulling stats from external password-protected files

    Quote Originally Posted by jameztown View Post
    Wow... thanks for your help thus far; i've spent about 6 hours on this trying to make it work! you are incredibly helpful; i can't even tell you...

    i get an error message when pressing the update button. it can't find my external worksheets. it's looking for the correct file [firstname_lastname_stats.xls] but it's giving me a run time error [1004]. I've tried moving this file around, wondering if it's reaching for the files in a subfolder; but, still can't get it to work. Any ideas?

    Right now, it should be looking in the same folder. I've placed summary.xls right next to all of the firstname_lastname_stats.xls files.
    yes, the worksheet in the external file is called 'summary'. It looks like it's getting caught up on the file name or location... run time error [1004].?

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

    Re: ByPassing Passwords when pulling stats from external password-protected files

    Hello jameztown,

    That is such a wonderfully vague error. The macro assumes the other files to be in the current directory. Maybe I need to change the macro to look in specific directory. Are these workbooks in the same folder as the workbook with the macro?

  10. #10
    Registered User
    Join Date
    05-24-2010
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    24

    Re: ByPassing Passwords when pulling stats from external password-protected files

    Quote Originally Posted by Leith Ross View Post
    Hello jameztown,

    That is such a wonderfully vague error. The macro assumes the other files to be in the current directory. Maybe I need to change the macro to look in specific directory. Are these workbooks in the same folder as the workbook with the macro?
    oh ok! yes... this file is in the very same folder.

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

    Re: ByPassing Passwords when pulling stats from external password-protected files

    Hello jameztown,

    I have added another variable to the macro called WkbPath. This variable nows holds the directory path of the workbook with the macro. This is now used with the other workbook names when opened. Here is the update code. This has been added to the attached workbook as well.
    Please Login or Register  to view this content.
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    05-24-2010
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    24

    Re: ByPassing Passwords when pulling stats from external password-protected files

    well, that error is now gone. Now it's giving me a runtime 1004 error telling me that my password is incorrect. I assume it's looking off the first name in the file 'Adrian Black', who's password is correct in my file?

    thx again for your continued assistance....

  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,258

    Re: ByPassing Passwords when pulling stats from external password-protected files

    Hello jameztown,

    This should work now. I added the workbook path to the workbook name. The workbook name is used to look up the password. Now the Filename is the workbook path and name.
    Attached Files Attached Files

  14. #14
    Registered User
    Join Date
    05-24-2010
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    24

    Re: ByPassing Passwords when pulling stats from external password-protected files

    Thanks! it looks like the files are being located and the passwords are working. For some reason, i'm now getting a run time 1004 error that says application-defined or object-defined error.

    It's placing the following in the 'stats updated' box for each person's code: 2522ort24ate ?? And, all of the boxes that I'm trying to pull stats from the external files are blank. Any ideas? Sorry!

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

    Re: ByPassing Passwords when pulling stats from external password-protected files

    Hello jameztown,

    I need to see the workbook. Can you post a copy?

  16. #16
    Registered User
    Join Date
    05-24-2010
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    24

    Re: ByPassing Passwords when pulling stats from external password-protected files

    okay; this is a copy of the workbook. I've just had to delete some last names; but, it should still show the errors that are coming up still... when I click 'update', the code under 'stats updated' - which should be blank - changes to 520ort25ate. If I press it again, it changes to 2522ort24ate. This loop is continuous. I'm not sure if that helps, though.
    Attached Files Attached Files
    Last edited by jameztown; 05-25-2010 at 12:03 AM.

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

    Re: ByPassing Passwords when pulling stats from external password-protected files

    Hello jameztown,

    Thanks for posting the workbook with the error. I have corrected the problem. I had made a typo. I typed "shortdate" when I should have typed "short date". Everything should now. Here is the corrected code. This has already been added to the attached workbook.
    Please Login or Register  to view this content.
    Attached Files Attached Files

  18. #18
    Registered User
    Join Date
    05-24-2010
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    24

    Re: ByPassing Passwords when pulling stats from external password-protected files

    thanks! there's still an issue with pulling the stats from the external files. under the 'stats updated' column - which should be empty - it now generates today's date and there is no data being pulled in the other cells.

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

    Re: ByPassing Passwords when pulling stats from external password-protected files

    Hello jameztown,

    I have updated the macro and tested it. On my end it works correctly. Let me know how it runs for you. Here is the updated code and workbook.
    Please Login or Register  to view this content.
    Attached Files Attached Files

  20. #20
    Registered User
    Join Date
    05-24-2010
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    24

    Re: ByPassing Passwords when pulling stats from external password-protected files

    Got it! It works perfectly. I can't thank you enough for your time and effort...

  21. #21
    Registered User
    Join Date
    05-24-2010
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    24

    Re: ByPassing Passwords when pulling stats from external password-protected files

    quick question, if you're able:

    I am now setting up multiple worksheets and I want to run the macro on the others. Basically, it will be the same macro except the code alters slightly to accommodate the next week of stats:

    from

    Please Login or Register  to view this content.
    to

    Please Login or Register  to view this content.
    I tried to implement this change by setting up another macro. Do I have to set up a new macro to this new sheet or can I use the existing macro?

    Sorry... I thought I was sailing to the finish line there

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

    Re: ByPassing Passwords when pulling stats from external password-protected files

    Hello jameztown,

    Are you saying each workbook will have more than just the "Summary" sheet and the same columns will be used but the row will change? Will each workbook have the same number of sheets? Will each sheet use only a specific row like "Summary" is row 16, "First Quarter" is row 18, etc?

  23. #23
    Registered User
    Join Date
    05-24-2010
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    24

    Re: ByPassing Passwords when pulling stats from external password-protected files

    Quote Originally Posted by Leith Ross View Post
    Hello jameztown,

    Are you saying each workbook will have more than just the "Summary" sheet and the same columns will be used but the row will change? Will each workbook have the same number of sheets? Will each sheet use only a specific row like "Summary" is row 16, "First Quarter" is row 18, etc?

    Hi Leith... yes; sorry. there is a summary sheet for each week of the year. all of the summary sheets are the same except they're pulling from the external sheet two lines below the previous week.

    All of the external workbooks are exactly the same; but with different stats. I've attached a new file showing this. I've also attached an example external sheet.

    Sorry! I'm confused; i thought I could take over from here as it seemed simple at first thought
    Attached Files Attached Files
    Last edited by jameztown; 05-25-2010 at 09:13 PM.

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

    Re: ByPassing Passwords when pulling stats from external password-protected files

    Hello jameztown,

    You will need to upload the "craig_h_stats" again. It is protected and all my software says it isn't an Excel file - WTF???

  25. #25
    Registered User
    Join Date
    05-24-2010
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    24

    Re: ByPassing Passwords when pulling stats from external password-protected files

    hmm.. okay; i've attached the file again. i've taken off the password too, just in case. thanks!

    i've trimmed down the external stat file. it goes until March 31st, 2011. So, I will be pulling stats weekly until that date in the current file that we've been working on.
    Attached Files Attached Files

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

    Re: ByPassing Passwords when pulling stats from external password-protected files

    Hello jameztown,

    Sweet, that opened with no problem. Nice layout on the "Summary" sheet. Is that your handy work?

  27. #27
    Registered User
    Join Date
    05-24-2010
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    24

    Re: ByPassing Passwords when pulling stats from external password-protected files

    Quote Originally Posted by Leith Ross View Post
    Hello jameztown,

    Sweet, that opened with no problem. Nice layout on the "Summary" sheet. Is that your handy work?
    haha, yes. the files have gotten pretty complex over the past few years for me and I'm trying to do more with the stats for comparison and to make things easier for me. Until now, I haven't been using VBA. I'm trying to get some crash courses on here and elsewhere; but, there's an endless amount to learn, it seems

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

    Re: ByPassing Passwords when pulling stats from external password-protected files

    Hello jameztown,

    I ran the updated macro on using the files you sent and it worked fine on my end. Check it out and let me know how it goes. Here is the updated macro.
    Please Login or Register  to view this content.


    This is a New Macro that was added in Module2
    Please Login or Register  to view this content.
    Attached Files Attached Files

  29. #29
    Registered User
    Join Date
    05-24-2010
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    24

    Re: ByPassing Passwords when pulling stats from external password-protected files

    I'll be able to test more tomorrow; but, after adding a month's worth of stats; it really is working perfectly. Your help has been tremendous to me; you are very kind...

    I'll update you shortly. thanks again!

  30. #30
    Registered User
    Join Date
    05-24-2010
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    24

    Re: ByPassing Passwords when pulling stats from external password-protected files

    Hi Leith!

    Everything works perfectly except when 2011 kicks in. We're a non-profit and our fiscal year is April 1st 2010 - March 31st 2011. All of the weekly pages run until the worksheet date is in 2011.

    Everything else is running flawlessly; this is sooo handy; I love it. Any ideas? I can change the worksheet names to include the year, if that helps.

    Thanks again!!!

  31. #31
    Registered User
    Join Date
    05-24-2010
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    24

    Re: ByPassing Passwords when pulling stats from external password-protected files

    I'm including a full copy of the workbook, in case that helps. The problem occurs on the jan 1st, 2011 worksheet and beyond. The previous file that I uploaded 'craig_h_stats.xls' will also work with this. Thanks again!

    having trouble adding attachment; I'll edit it in...

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

    Re: ByPassing Passwords when pulling stats from external password-protected files

    Hello jameztown,

    I have added the fiscal year fix to the second macro. Here is the code. Replace Module 2's with this.
    Please Login or Register  to view this content.

  33. #33
    Registered User
    Join Date
    05-24-2010
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    24

    Re: ByPassing Passwords when pulling stats from external password-protected files

    I still can't seem to get it to work. I've tried to edit the Macro; but, now it doesn't say 'module 2' it says 'sheet 2', Now that i've 'played with it', it now says 'module 3'. I'm awfully confused.

    I can't seem to upload my file on the site still.

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

    Re: ByPassing Passwords when pulling stats from external password-protected files

    Hello jameztown,

    I just looked at the sheet "Mar27" in the "Summary" workbook. I think I need new glasses. You have the full date in cell "I1" - 27-Mar-2010. Let me make another change to this and I'll post the macro code and the workbook.

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

    Re: ByPassing Passwords when pulling stats from external password-protected files

    Hello jameztown,

    This should work 100 percent now. Here is the updated macro. I have removed Module 2 from the attached workbook, since it is no longer needed.
    Please Login or Register  to view this content.
    Attached Files Attached Files

  36. #36
    Registered User
    Join Date
    05-24-2010
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    24

    Re: ByPassing Passwords when pulling stats from external password-protected files

    Perfect; just perfect. I've filled out the workbook completely and everything is perfect. Just the way I want it. You're the best...

+ 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