reate a fresh workbook and place the following code into the ThisWorkbook
ws As Worksheet
ws = ThisWorkbook.Worksheets(1)
= "Everything is OK."
Create a Module and place the following macro code.
Sub testMacro(i As Integer)
Save, close and reopen the workbook. Go to VBA window and execute the
following line in the "Immediate" window.
The Excel application becomes non-responsive. This happens with a freshly
created workbook, when all add-ins are deactivated, including the PFE addin.
Only the VBA code is involved. The result is the same for Excel 2000 and Excel
There are three points that I want to propose after such experiment.
First, no matter how hard I try I cannot shield dear user from the fact that
Excel remains to be a buggy application. Not every bug is my fault.
Second, the ExecuteExcel4Macro works fine in most situations. Perhaps, using
the Activate() methods in the "open workbook" event handler is not a good
idea. The pfe-files are a principal tool of this product and these are
executed in the "open workbook" event handler. Please, remember that there are
slightly different rules of execution for the pfe-script itself and for the
event handlers that the pfe-script installs.
Third, Excel bugs are easy to replicate and localize. Consequently, there is
always a reliable way around any bug that you might encounter.