On one of my Padlocked applications, I locked down the VBA so that nobody could see the Project code. On most computers it works just fine, but on one of them, when I exit the locked application, I get the message “Project Is Unviewable” even though I’m not even trying to look at it - just closing the applicat6ion. Then I get the message, “Excel has stopped working”… and it crashes.
Looks like your VBA code has a problem and Excel tries to open the VBA editor to show you where the problem is. If you enabled “Prevent access to VBA editor”, then that’s the reason of the crash because Excel blocks the UI by default until you press Continue (which is inaccessible since you can’t access VBA editor…).
Make sure your original VBA code works on the faulty computer.
I have the same problem. On my Padlocked wb, on the workbook_close event, I put a msgbox that asks if the user wants to print to pdf. If they answer no, it should just close, but instead it gives this error and crashes:
I’ve commented out the last part of the workbook_close event (that just clears contents of a sheet), but it still does this crash. When I open the exe and only type in some data on the main worksheet and close, it doesn’t crash, but if I go in, fill in some cells with data, run a userform that displays report data and close UF, then close workbook, it crashes.
I’ve also tried putting On Error Resume Next before the ending part that clears that one sheet. Nothing’s working, so I can’t yet publish this final protected version.
Thanks for any advise.
First you should try to disable Lock VBA project in XLS Padlock to see if it helps or not.
That did help. I deselected “Lock VBA project” and still have the other VBA checkbox checked.
Will this be enough security for people to not be able to ever see my VBA? If so, I will leave it at that.
I had also tried some error trapping methods and was unsuccessful - this error occurred after the Workbook_Close() event, so I couldn’t do anything to trap it or view it.
I encountered the exact same problem and managed to isolate the error:
The ingredients required to receive this error:
- Excel 2007 (maybe 2010 I haven’t tested)
- Lock VBA Project (simple VBA protection) markup with V
- Workbook_BeforeClose event macro, in the macro add some code that insert some value somewhere and ThisWorkbook.save command in the end
And you will get this error message.
This does not appear to be due to an error in the VBA code but something with the XLS Padlock
Support please check and fix
Same question: you should try to disable “Lock VBA project” in XLS Padlock to see if it helps or not. Maybe you have an error in your Workbook_BeforeClose event, or something occurs. Since the VBA project is locked, Excel cannot show you the error and displays this message “Project Is Unviewable”.
I have already tried to disable “Lock VBA project” in XLS Padlock, and Indeed, this error does not occur, but the reason for this error is not the VBA code because:
Even with one line of code in the Workbook_BeforeClose event, the error occur (like I said only in excel 2007 and in my excel 365 the same code works perfect.)
of course I dont want to distribute my EXE files without this “Lock VBA project” feature only because of excel 2007 users but a customer of mine use excel 2007 and this message jumps every time he close the EXE file, and to distribute a version only for 2007 is crazy because I already need to manage for every product of mine a 32 bit version and 64 bit version and simple and pro variation…
And is your user working with Excel 2007 SP3 (or is it up-to-date)? As you know, Excel 2007 is rather old and it can contain bugs solved in more recent Excel updates…
I did another test on my wife’s old computer, which has a Windows 7 with Excel 2013, and this message is also received there.
I take back what I said about Excel 2007 and what is common to all the computers that this bug takes place, is that every computer has Windows 7.
Is it possible?
Anyway, it will be difficult for us to fix this issue since we cannot reproduce it. Do you think you can give us your workbook (or a sample workbook that would show the problem)?