0

I have the following issue:

  1. I created an Excel sheet in XLSB format.

  2. To protect that sheet, password generated by performing some operations on present month and year which would be a numeric value.

  3. Used input box to get a password from the user in a string variable.

  4. step 2 and 3 done in workbookopen event.

  5. I closed the workbook and when again opened was prompted for the password which would never match even though I know the password.

What to do now? I have tried disabling macros but it doesn't seem to work.

finally tried following command

Application.EnableEvents = False

Which does exactly what i want but is not working for my sheet, though same is working fine for another trial sheet.

Sub disableCtrEvents()
    Application.EnableEvents = False  'disable Events
    Workbooks.Open "<path>\Wall area.xlsb"
    Workbooks.Open "<path>\STAAD to steel drawing.xlsb"
End Sub

Following three files can be dowloaded from the link

test.xlsm - containing events disabling code (written above) and code to open other two sheets.

wall area.xlsb - trial sheet to check whether events are disabled or not.

STAAD to steel drawing.xlsb - actual file wherein i want to disable workbook open event

link - https://drive.google.com/open?id=1d_3Tu_-qIYErgYVkOjrCP4b8sZagXxF1

  • 1
    We are not here to do your work. If you have code that you struggle with please add a sample so we can help you with that. – Luuklag Mar 27 '18 at 12:26
  • I don't know what exactly you understood but it seems to me you didn't understand a thing. It's not my work neither it can be anybody's work, to bypass password protection implemented through inputbox in excel VBA . That's what I am struggling with. I have clearly stated that in workbookopen() subroutine I have asked for input password and same has to match with a number generated by doing some mathematical operation on system date. Now if inputbox variable is string and generated password is number it's would never match and worksheet would never open.hence how to circumvent workbookopen() ? – parikshit verma Mar 27 '18 at 16:43
  • That code submission thing was only to stress at the point that it's urgent thing. I dont want people to do my work , which by the way is already finished. I code because I like it not that it's my job. I work as a civil engineer. This submission is my commitment not an official project. – parikshit verma Mar 27 '18 at 16:51
  • If you have forgotten the password, or accidentally set the password to a string that you did not intend, then you may have to brute-force search the password. There's utilities online to do this (obviously only use ones you trust, as there's bound to be ones with free malware included). – halfer Mar 27 '18 at 21:57
  • Please read [Under what circumstances may I add “urgent” or other similar phrases to my question, in order to obtain faster answers?](//meta.stackoverflow.com/q/326569) - the summary is that this is not an ideal way to address volunteers, and is probably counterproductive to obtaining answers. Please refrain from adding this to your questions. – halfer Mar 27 '18 at 21:57
  • @hafter ok i think i need to modify my post then – parikshit verma Mar 28 '18 at 03:43

0 Answers0