XLSPADLOCK VBA Lock

I am using version 1.4 and do want to use the simple VBA Lock feature.

In my non encrypted file I did not use a vba password and with the simple VBA Lock feature I did expect that in the protected file my vba project would not be visible as metioned in the release notes. However the VB Editor opened without any problems and the code was still visible.

I then entered in my original vba project a password to avoid visability and after compiling I could open the VB Editor but did get the request to enter the password (as to be expected).

How come that when using the simple VBA Lock feature the project does not get marked as not visible ? Am I doing something wrong ?

Thanks

Which version of Excel are you using?

Microsoft Office Professional with MS Excel 2010 on Windows 7. Besides the fact that the VB Editor opens with the request for a password for the VBA Project, when hitting cancel I do get an Error Window stating:
System Error &H80004005 (-2147467259)

Is there any news on this item ? Are there any other users out there that see the same problem in Excel 2010 ? Would appreciate to know if I am doing something wrong or if there is a bug in the software.

Forgot to ask: Are you using an XLS or XLSX file format? VBA locking seems to be working in Excel 2010, no bug report from others.

XLS format only.

Maybe your XLS file has a particular format. Is it possible for you to send it by email or PM?

I though about that myself and therefor did try it also with a blank XLS sheet. Here is the log of activity:
I opened a new file, when I wanted to compile the file I was being asked to save it first which I did and after that I activated ONLY the simple VBA protection and compiled the empty sheet. After compiling when being asked to test the application the file opens, the developer ribbon button is hidden but when I right mouse click on the “sheet1” (one of the 3 standard sheets in an empty workbook) and select “view code” the VBA Editor opens without any problems. In a next verification test I did also compile/protect the sheet with “disable all ribbons and toolbars” and “disable right click” which however did not stop me from being able to select “sheet 1” again and right click with view code open the VBA Editor.

The VBA editor is not disabled, it’s normal, but can you still access the VBA project? Do you see the “Project is locked” prompt?

According to your product guide 1.4.0 on page 18 section 5.2.9 there is a description where the editor is most definitely disabled and the exact wording in your product guide is:

“Enable this option if you do not want your end users to access your VBA project. This feature doesn’t use password protection, it marks the VBA project as locked: it can’t be viewed, accessed or modified.
If the end user tries to access a locked VBA project, the following error message is displayed (Project Locked – Project is unviewable)”

Beyond that, if the VBE editor is enabled what is the use anyway of feature ? I do need to hide my complete VBA project in the same way it is described in your product guide and would not like anyone give the opportunity to enter passwords at all. Could you clarify what I need to do to get the VBA editor locked and the Message Window “PROJECT LOCKED - PROJECT IS UNVIEWABLE” in excel 2010 ?

We are trying to reproduce the problem with Excel 2010 in Windows 7.

I did install now also Excel 2007 to verify whether the problem is related to Excel 2010 only but also here I am not able to lock a vba project and make it unviewable as indicated in your product guide. I used a very simple empty macro enabled workbook (.xlsm) containing some very simple lines of VBA code on sheet1 VBA editor:

sub hello()
msgbox "hello"
end sub

Are you sure that the simple VBA lock feature to make the VBA Editor unviewable is actually working in Excel 2007 & 2010 ?

Followed your sample and it works. Now, which exact version of Excel 2007 are you using?

Here are some screenshots:

And when running the EXE file, and trying to access VBA code:

Which is “Project Locked” in English.

I am using MS Excel 2007 (12.0.6683.5002) SP3 MSO (12.0.6683.5000) which is a Home & Student License and Excel 2010 (14.0.7132.5000) SP2 MSO (14.0.7128.5000) which is a Home & Business License.
Both Licenses were fully updated and are running Windows on a fully updated 7 Home Premium 64-bit SP1 machine.

Fearing that the issue might be register related, I have executed a “repair” of MS Office on the computer (after updating to the last version of xlspadlock something might have gone “wrong” and wanted to be sure that all registers are OK) and I can now produce the same results as you have shown. This is the good news. Going from this simple example file to my complex workbook the protection however did not work. After a few long investigations I can reproduce - also in the simple example file - a NON VBA Lock occurence (meaning VBEditor opens) in the following conditions:

  1. Protect WorkSheet with a password AND use your random generated workbook password (which is not asked at the final client) the VBA editor opens. If I leave the random generated workbook password feature blank the VBA project is unviewable.
  2. Protect WorkBook with a password AND use your random generated workbook password (which is not asked at the final client) the VBA editor opens. If I leave the random generated workbook password feature blank the VBA project is unviewable.
  3. If I use an orginal by password protected excel sheet (for opening) and then protect it in xlspadlock with the random generated workbook password feature blank (as is written in the product guide) the VBA Editor always opens. I could not find a way of making the VBA project unviewable.

In summary I can make my projects now unviewable and protect the sheet and workbook structure, but I cannot use the extra xlspadlock file access random password protection. That feature does always make my VBA project visible.

Another thing I noticed: When entering the password for protected sheets in the application settings during compilation (as xlspadlock needs to apply formula protection) and entering by mistake an erroneous password the compile procedure ends with the message window “compilation successful”. It would be very nice to have an error flag window that advises the user that the compiler has found an inconsistency in the password entered and the password in the file.

Thanks for your help !

I am still waiting to hear from you on the above mentionened issue that when I use a password protection as described again below I cannot lock the vba project from being unviewable. Any ideas on this ?

Here is again the problem:

After a few long investigations I can reproduce - also in the simple
example file - a NON VBA Lock occurence (meaning VBEditor opens) in the
following conditions:

  1. Protect WorkSheet with a password AND use your random generated
    workbook password (which is not asked at the final client) the VBA
    editor opens. If I leave the random generated workbook password feature
    blank the VBA project is unviewable.
  2. Protect WorkBook with a password AND use your random generated
    workbook password (which is not asked at the final client) the VBA
    editor opens. If I leave the random generated workbook password feature
    blank the VBA project is unviewable.
  3. If I use an orginal by password protected excel sheet (for opening)
    and then protect it in xlspadlock with the random generated workbook
    password feature blank (as is written in the product guide) the VBA
    Editor always opens. I could not find a way of making the VBA project
    unviewable.

In summary I can make my projects now unviewable and protect the
sheet and workbook structure, but I cannot use the extra xlspadlock file
access random password protection. That feature does always make my VBA
project visible.

Another thing I noticed: When entering the password for protected
sheets in the application settings during compilation (as xlspadlock
needs to apply formula protection) and entering by mistake an erroneous
password the compile procedure ends with the message window “compilation
successful”. It would be very nice to have an error flag window that
advises the user that the compiler has found an inconsistency in the
password entered and the password in the file.

Thanks for your help !

I put your suggestion on the TODO list.
We are also investigating another way to stop access to the VBA editor.