I’m currently building a VBA based application on Microsoft Excel.
I used simple activeX control to get the user ID/password. The problem with this is that the user might be able to view the password’s value by viewing the “properties” of the activeX label
Is there any way that I can prevent the user from activating the “Design” mode and seeing the values of the textboxes directly? Or is there any better way to store the credentials on the system? The reason why I use the textboxes is because they are simpler for the user to use (you can save the value and hence you can use the program in the future without the need to retype the userid/password again) and it’s simple to maintain (no need forms/popups)
Thank you for your help.
This is how the id/password box on the sheet look like (using activeX control)

The problem is that the user can see the value of the password textbox if they open the design mode -> properties

I would create a UserForm to handle the username/password system. The form could save the username and password to a very hidden sheet by setting the ‘Visible’ property for the sheet to ‘xlSheetVeryHidden’ in the VBA IDE. The sheet can’t be unhidden unless you go into the VBA IDE and change the visible property.
When the form is opened, load the data from two ranges on that sheet. You can set the range names to be hidden from the Name Manager in case you are concerned about users working out the range names and putting the value into a cell.
The only people who would know what the cell range names are, and where to access them, would be those with access to the VBA code. So protect that with a password and it will be as secure as you can make it in Excel, well at least in my view.
Security is a relative thing in any case. How secure something needs to be depends on how important the data is. If it is just to keep people from messing with things they shouldn’t then simple security is fine. If it is highly confidential data then you shouldn’t be allowing users to save a password anyway. A username perhaps, but not a password.