Overall what you describe sounds very similar to many of the applications I
have written that do not have this problem.
One difference is that I build the app as an XLA addin which contains
worksheets on which I put the blocks of data, formulae, formats etc which
the app uses to create the user workbook.
When creating a sheet for the user I do not copy worksheets but create a new
one and transfer the required information at the range level, using
Range=Range and copy paste special for the formats, or copy and paste.
Double check that you have switched calculation to manual before doing the
copy/create process ...
Are you using Excel Defined Names, or are the names you enter just text?
Could you give an example of:
- the code you are using to copy
- the formulae you are copying
If Excel crashes in a repeatable way when calculating after data entry and
you are not using any event trapping then you could try and isolate the
problem to a specific formula by (in Manual) doing a sheet calculate to see
if its a specific sheet, then range.calculate on blocks of formulae etc.
(download my RangeCalc addin if needed)
Voodo checklist:
- Option explicit?
- Do you set all object variables to nothing in reverse container sequence
before exit subs/functions?
- Do you use Rob Bovey's code cleaner?
- Do you delete all temp files in %Temp%?
- What is the size of your .XLB file?
- Any other add-ins loaded?
Charles
______________________
Decision Models
The Excel Calculation Site
www.DecisionModels.com
The application has 8 worksheets, 3 of them very hidden. One of them is
always visible, and the remaining 4 may or may not be visible depending on
configuration and circumstances.
The problem seems to lurk in one of the usually hidden sheets. What
happens
is after the user uses the application up to the point of invoking the
function that prepares and makes visible this sheet. The function, or
series
of functions actually, that do this pretty much constructs the sheet from
one of the very hidden sheets. The very hidden sheet is copied over to the
malfeasant sheet, including lots of cells with lots of conditional [if,
choose, etc.] formulas. There is no problem with cell references coming
over
they are all correct, each and every one of them.
At any rate if I shut off calculations and then invoke the process to
create
the final sheet, all works fine, except there's no meaningful data of
course. If I then provoke the calculations manually, voila, the bugger
dies.
If I leave calculations on and do this it still works and all of the data
is
right where it's supposed to be and it's all correct. But if I go back to
the first sheet and attempt to enter another name, either from the
keyboard
or from a menu provided by the application, death once more.
Stepping through in debug or setting judicious breakpoints doesn't tell
much, and seems to subtly alter the internal timing such that it seems
less
likely to fail when messing around with it. it's when this final sheet is
made visible and activated with normal calculations that the thing sets
itself up to die. Even at that, death comes from other circumstances, this
is simply the one that I can make happen each and every time. By the
principles of basic debuggery, fix this and the others will most likely be
fixed as well. If I knew just what in the hell it was doing to itself.
Vis-a-vis trace log, if it's something for me to implement, no. If it's
some
feature of Excel I can't seem to find any reference to it.
Thanks for your interest...
--
Terry
"I said I never had much use for one,
I never said I didn't know how to use one."
M. Quigley