Hi All,
Hope you can guide me as to what is not working. The reason why I want to unlock the VB project is due to a corporate tool making the
'Password' box appear when exiting the application. I am not sure of a work around other then unlocking the VB project of the add-in when exiting Excel so the Password prompt does not populate. The file is a 2003 add-in.
It should work and sometimes it does but majority of the time it seems to 'misfire' and either not enter the PW or enter it incorrectly. Sometimes it seems to open the personal workbook project and try to unlock that. So I tried this:
Again, it seems to be doing everything correctly up to the point of send keys. It seems to work when it wants to. Any input or ideas would be greatly appreciated.
Hope you can guide me as to what is not working. The reason why I want to unlock the VB project is due to a corporate tool making the
'Password' box appear when exiting the application. I am not sure of a work around other then unlocking the VB project of the add-in when exiting Excel so the Password prompt does not populate. The file is a 2003 add-in.
Code:
Application.Wait (25)
SendKeys "%({F11})", True
Set Application.VBE.ActiveVBProject = ThisWorkbook.VBProject
SendKeys "%(TE)" & "enterpwhere" & "~~%({F11})", True
It should work and sometimes it does but majority of the time it seems to 'misfire' and either not enter the PW or enter it incorrectly. Sometimes it seems to open the personal workbook project and try to unlock that. So I tried this:
Code:
Do Until ThisWorkbook.VBProject.Protection = vbext_pp_none
SendKeys "%({F11})", True
Set Application.VBE.ActiveVBProject = ThisWorkbook.VBProject
If Application.VBE.ActiveVBProject.FileName = ThisWorkbook.FullName Then
SendKeys "%(TE)", True & "tf09232003" & "~~%({F11})", True
DoEvents
loop
Again, it seems to be doing everything correctly up to the point of send keys. It seems to work when it wants to. Any input or ideas would be greatly appreciated.