Excel crashes after opening an unprotected workbook with VBA

Status
Not open for further replies.

ArthurBorsboom

New member
Hello,

We are using XLS Padlock v2.4 to protect our VBA application. Recently a customer pointed out that Excel crashes after he opens a macro enabled workbook in combination with the protected XLS Padlock application. We have been able to pin it down and reproduce this by the following steps.
  • Create a new Excel workbook.
  • Open the VBA editor and add the following two lines to the “ThisWorkbook” section.

    Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
    End Sub

XLSPadlock4.PNG1024×620 26.8 KB

  • Save the Excel workbook as an macro enabled workbook, e.g. Book1.xlsm.

XLSPadlock5.PNG683×506 33.9 KB

  • Close Excel
  • Start the protected (XLS Padlock) workbook/application (myapp.exe)
  • Open Book1.xlsm
Excel will start producing the following errors.
  1. Can’t move focus to the control because it is invisible, not enabled, or of a type that does not accept the focus.
  2. OLE 800A03EC (this one keeps repeating until Excel crashes)

XLSPadlock6.jpg1920×1200 481 KB


What is the cause of this error and how can this be prevented?

Best regards,
Arthur Borsboom.
 

Attachments

  • XLSPadlock4.PNG
    XLSPadlock4.PNG
    26.8 KB · Views: 0
  • XLSPadlock5.PNG
    XLSPadlock5.PNG
    33.9 KB · Views: 0
  • XLSPadlock6.jpg
    XLSPadlock6.jpg
    481.3 KB · Views: 0
Thank you for the bug report. The VBA event seems to be the culprit.
You can prevent it with the following option:

image.png760×462 41.6 KB


As an alternative, your customer can open another Excel instance before opening Book1.xlsm
 
I have tried the option “Do not allow loading/save other workbooks”, but it does not give the result I was hoping for. This is what happens now.
  • Start the protected application ‘myapp.exe’ with the setting ’ Do not allow …'; Excel opens as expected.
  • Open a new unprotected Excel from the Windows desktop, e.g. ‘Book1.xlsm’.
This gives the following error, which I am sure, customers don’t understand why their Excel is ‘not working’ anymore.


XLSPadlock-Do-no-load-error.PNG989×111 6.07 KB


Am I doing something wrong? Or better, how can I make sure the workbook opens normally?
 
For other people visiting this thread:
1610_2.png
"Save As" not working for non-protected workbooks XLS Padlock
That is indeed unfortunate and a limitation of XLSPadlock. Because of this, we might have to abandon XLSPadlock and move to a VB.net solution, although that will be quite some work and besides this I am satisfied with XLSPadlock. Are there any plans to improve this behavior somehow?
 
Status
Not open for further replies.
Back
Top