Code that Crashes Excel without fail - Excel 97 SR2 WinNT
Hi again Matt,
You do keep coming up with some obscure things <g.
Following your instructions I replicated your crash in xl97, several times.
Then I exited design mode and no more problems, I mean in further testing no
crashes no matter what state design mode - weird - yet again with your
topics!
In our previous conversation I said some things relating to controls in xl97
are best done in design mode. Though it turned out not relevant to that
issue I stand by it as a generalised statement. But now perhaps I should add
some things are better NOT done in design mode. I can no longer replicate
the problem / solution but try folowing (new session's of windows etc):
If Application.CommandBars("Exit Design Mode").Controls(1).State =
msoButtonDown Then
Application.CommandBars("Exit Design Mode").Controls(1).Execute
End If
Regards,
Peter T
"Matt Jensen" wrote in message
...
Howdy all
I've been having a problem with Excel 97 crashing that I've been able to
narrow down through a process of elimination to the following cause (there
is no problem on WinXP Excel 2002 by the way):
Steps to produce a crash:
1) Create new workbook
2) Insert a Control Toolbar Checkbox on Sheet1.
3) In any cell on Sheet1, put something in a cell (so that when you choose
the Excel menu option 'Print Preview' it won't say 'nothing to print' and
will attempt to show a print preview) eg. type the letters 'text' in cell
A1
of Sheet1.
4) Go to VBE, create new module, enter this code:
Sub ExampleCrash()
Worksheets("Sheet1").OLEObjects("Checkbox1").Delet e
End Sub
5) Run Macro
6) Return to Excel
7) Hit Print Preview
Excel crashes WITHOUT FAIL for me on a variety of machines with Excel 97
SR2
on WinNT. It is a large organisation where I'm working - 100s to 1000s of
users with same PC setup (so therefore I have no control over what my
users
will be running).
Firstly, does this cause Excel 97 to crash for anyone else?
Secondly, what is the problem? Is my code the problem - if so, how can I
change it to stop Excel crashing?
Any suggestions as to how I can change the code to still achieve the same
effect but not crash Excel? Eg. maybe force a save after the macro or some
other trick of the trade / "workaround" that might prevent Excel from
crashing?
Thanks a lot for any help or ideas - I'm not sure where to start!!
Cheers
Matt
|