Vba protection crash in 2.1.1

I have just installed 2.1.1 and have run into problems with protecting vba code.

I am using excel 2010 for compiling and testing on excel 2007 the exe.

Selected options

  • I did set a password for the VBA project in my vba developer window.
  • I did NOT select “lock VBA project” in XLSPAD
  • I DID select “hide” developer window. in XLSPAD

After compiling the workbook and opening on the workbook I can right click on the sheetnames and ask to show me the vba code. When doing so a “quick” window pops up where one can very briefly see the vba developer explorer (and code) as it was left before compiling the original file and then that window disappears. The workbook remains however not accessible and initially I had to kill the file, but it turns out that “somewhere” a window has appeared that can only be found with Alt-Tab and select it with mouse (windows 7) in which one is being asked to enter the password for the vbaproject. When hitting cancel vba crashes with an error but the workbook becomes then again accessible.

Removing the original password in the developer window does not change anything. I still find that window asking for a password and when clicking cancel vba crashes.

When in fact locking the vba project in XLSPAD with a password in the developer window it crashes as indicated in your warning and when locking the vba project in XLSPAD without a password in the developer window I do - again when selecting on a worksheet name show code - get a pop up window that I can only find again with Alt-Tab and select it by mouse with the message “project unviewable” and when hitting OK vba crashes but the workbook becomes available.

I assume that there is somewhere a problem closing down message windows or priority to show windows above other windows.

In 2.1 it seemed that the issue of vba protection was more or less resolved. I have for the moment only tested the executable on 2007 and will look into 2010 and 2013.

any advice is appreciated. Would it not be possible to just “block” right mouse click “select code” option on each worksheet in the workbook ?

Unfortunately, it is a known problem of the “Hide VBA project” feature. However, there is no solution yet. If you choose “Show Code”, you’ll be prompted for the password. But the window will be made inaccessible by the Hide VBA project" feature.

I do understand that. The problem “on top” that I am facing - which was not in 2.1 - is the fact that the window where one is prompted for the password does not appear on top of the sheet (as it did in 2.1), but appears/disappears quickly and is then somewhere “hidden” on the desktop with for some reason also without any “window icon” on the taskbar (alt-tab does bring up all windows in a table and lets you select the prompt window again) which led me to believe initially that the workbook had become useless. Then after having been able to select the window via Alt-Tab and press cancel on the prompt password window the vba code crashes with an error code H80004005 (-2147467259) which was not the case in 2.1

We’ll try to reproduce the issue

I have tested the workbook now also on excel 2010 and when right clicking on any worksheet name in the workbook I can only see select to “unprotect” the worksheet but i cannot see or select “view code”. This would mean that it seems to be a specific excel 2007 problem. I hope this helps identifying the issue.

Yes,we hope too.

In the meanwhile, the “View Code” menu command can be disabled only in Excel 2010 and later.

Any news on the issue why version 2.1.1 is crashing in excel 2007 (as mentioned in my thread before) when version 2,1 did not do this ?

In Excel 2007, what length did you use to password protect your VBA project?

I test with both a password with 15 characters and no password at all in the developer window. Same result

Is it possible for you to send us both your Excel workbook and compiled EXE file?

If yes, you can zip them and upload them to http://demo.ovh.eu/en.
This is a free and ad-free hosting service: after upload, they will give you a
URL. Please give us this URL so we can download the Zip archive.

you can create a file by yourself quickly to reproduce the error: It is not an error caused by custom code

I used excel 2010 for this:

open a blank workbook
create a few lines of code
protect the code with a password - i used "1"
hide a worksheet in the workbook
protect the workbook with a password - i used "1"
compile the workbook and prevent access to VBA editor

open workbook in excel 2007
right mouse click on sheets in workbook and select unhide sheet
nothing happens
use alt tab to find message window
click on window
select cancel
crash

again this was not happening in 2.1

Which exact Excel 2007 version do you have? Any service pack?

Office 2007 12.0.6727.500 SP3 MSO which means Service Pack 3

Should be fixed in V2.2.

Fantastic and when can I expect V2.2 ?

Today, just check the website :wink:

Great ! I did try it and the crash disappeared … but only for the first few files that I protected and than it came all back again. I did not get a crash report.

What version of XLS Padlock do you use now? And that’s strange that the error goes away and comes back.

Crash reports only occur in XLS Padlock designer, not in compiled workbook applications.

I just upgraded to 2.2. It is indeed very strange. First it all worked well, which made me happy for my 2007 clients. Then I decided to try again to test the feature of “adding a password but not asking the password to the user” as indicated in the menue and the old crash error came up again. After that I could not get rid of it anymore.

Please try the new version 2.2.1 released yesterday.

BTW are you using any antivirus program on the machine with your Excel 2007?