Hello Forum,
I should begin by informing you all that I have implemented a method which tackles the so-called 'Force Enabling of Macros' dilema. A post thread on this site provided a solution whereby a generic sheet is the only visible sheet upon opening the workbook with a text message stating that the 'Enable Content' button must be selected to view the workbook's main content. Once the user clicks the 'Enable Content', a macro hides the prompt sheet and unhides the main content sheet. A new issue is that it has become neccessary to only allow access to a predetermined group who will be given unique usernames and passwords.
I have created a user form that is opened with the 'On Open Workbook' event. It has two text boxes, one for username entry and the second for password entry. These user entries are delivered to two cells in a veryhidden spreadsheet which includes a column containing usernames and a column containing corresponding user passwords. This sheet is set up so that these columns are used in connection with the cells referencing the user entry inputs. The two vlookup cells in the sheet are nested within an iferror formula which will return the value of the match, be it username or password, if there is a correct match, or the value, 'No Match', if vlookup returns an error. Ultimately, a third 'IF' formula cell checks whether both of the vlookup cells matched; if both matched then the formula returns the value, 'Yes' and if both didn't match, the formula returns the value, 'No'.
The issue arises when this third 'Yes/No' formula cell is used as the determining value for a VBA module which is pivotal in allowing access to the main workbook content sheet.
The code does not cause an error, but does not perform reliably, i.e. it will sometimes allow an incorrect username and password into the main content, and sometimes deny access to a correct username and password?
Any help/alternatives will be greatly apprecaited,
Thanks
Bookmarks