Link to home
Start Free TrialLog in
Avatar of rutherfordcpa
rutherfordcpaFlag for United States of America

asked on

VBA asking for a password

We have a spreadsheet that has password protected VBA (viewing also).  From time to time, our users experience an Excel menu popping up asking the user to enter a password.  The menu shows the VBA project's name so I assume it is VBA that is requesting the password.  We do not have passwords anywhere else in the document.

The user is not attempting to gain access to the VBA, but merely operating the spreadsheet and running the various macros.

What sorts of things ask for the VBA password when direct access to VBA is not being requested by the user or required to run the macros?

What coding should I be looking for that might need to change to prevent this password request?
Avatar of Peter Chan
Peter Chan
Flag of Hong Kong image

Did you protect the sheets or not? You can check your VBA codes to find out the one prompt for password and consider to disable that.
Avatar of Roy Cox
There should be no code that requires the VBA password. Can you provide a screen shot of the message.
Avatar of rutherfordcpa

ASKER

This is a screen shot of the password request.
password.jpg
That looks like a UserForm, it is not generated by Excel but by VBA code.

Can you attach the workbook.
I have another screenshot for you... when I open VBA and unlock the project, I get the same prompt as the users get... but, of course, I should be getting this prompt since I am accessing VBA.
password2.png
I can see now that the Project has been renamed to LandLord. It should not dispaly that message if the Project is unlocked.
Roy:

I am sorry but I am not following you.  The project was always named 'Landlord'...  the last image was just to show you that it is indeed VBA asking for the password.  The message prompt is identical to the user who does not access VBA.  The VBA is always locked for the user.  I guess I am still confused as to why VBA is asking a user to unlock the VBA.
Sorry, I hadn't realised that the Project was named landlord, hence I thought you were getting a userform or message box.

There is no reason why you should get that message if the project is not protected and if it protected then the message should only display if someone tries to access the VBA project.

Have you tried removing the protection in the project, i.e untick "Lock the project for viewing" and delete the password. Close and Save. Then see what happens when the workbook is re-opened.
Unfortunately, the issue happens rarely with my users so I can't duplicate it.  The project must remain locked because it is intellectual property.

I was just  hoping that there might be someone that has experienced this before and had some suggestions.  I realize I am asking for a open-ended diagnosis.

Thanks!
I wasn't suggesting that you leave it unlocked permanently, simply to test.

If it happens infrequently then could it be a setting on the user's computer?
I am going to close and cancel the question.  I appreciate the feedback, but I think apparently it was an open-ended question.
ASKER CERTIFIED SOLUTION
Avatar of Roy Cox
Roy Cox
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial