Results 1 to 4 of 4
  1. #1
    2 Star Lounger
    Join Date
    Feb 2003
    Location
    Piscataway, New Jersey, USA
    Posts
    171
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Funny password problem (Excel 2003 Office XP SP2)

    Hi everybody:

    I have a single-user application that has been in production for 2 years, with continual changes. Its purpose is to copy just the values from sheets in the user's working worbook into a nice, plain vanilla workbook for importing into a commercial software package.

    It has two regular modules and 2 small class modules that initialize the application so a custom toolbar can be displayed when the user hits some keys and then be deleted when the code finishes or the user closes the workbook.

    Since the user created some additional workbooks (for 2006) and I imported the modules into them, we're getting a funny password problem. All the workbooks are password protected, but I can't find any external links among any of them. But with the original workbook, unless Excel is closed and re-opened, when the user clicks any of my custom toolbar buttons, an Excel dialog box requests the password for the previously opened (and currently closed) workbook, whichever that one was. If the user enters the password, all the code runs correctly, but she's unwilling to do this. If she cancels, MS returns error 400.

    I can't for the life of me find any difference between this workbook and any of the others. The code modules are identical. There are no links.
    Could this be due to workbook corruption, something in a hidden sheet, or some weird Excel behavior? Also, does anyone understand what the error 400 would mean in this case?

    Thanks, in advance, for your help.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Funny password problem (Excel 2003 Office XP SP2)

    I would guess that the toolbar buttons refer to the macros in one of the other workbooks, either because the toolbar buttons haven't been deleted properly when the other workbook was closed, or because of the way the toolbar buttons are created. You can inspect this by selecting Tools | Customize..., right-clicking one of the custom toolbar buttons and selecting Assign Macro...

  3. #3
    2 Star Lounger
    Join Date
    Feb 2003
    Location
    Piscataway, New Jersey, USA
    Posts
    171
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Funny password problem (Excel 2003 Office XP SP2)

    Hans, you're a genius!

    I ran the code several times successfully, and when the password popup appeared, checked the macro assignments and, sure enough, instead of referencing the current workbook's button macros, I saw a full path to the previously opened filename and the same button macros there. My error was in not deleting the already existing bar, which had been created from the previous workbook's code, and somehow "remembered" where that code had originated, instead of looking at the SAME subs in the SAME module in the active project.

    I'm wondering why this just started happening . . . do you think it might have to do with upgrading to Excel 2003 SP 2 on XP from 2000, or something else?

    Thanks!

    Kathryn

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Funny password problem (Excel 2003 Office XP SP2)

    There are several possible explanations, but without seeing the actual code it is hard to say which one is most likely.

    For example, if an error occurs, Application.EnableEvents may have remained set to False, so that the code that deletes the toolbar isn't triggered.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •