Interrupted sheet copying causes phantom Book2
This line:
Sheets("sheet1").Copy
should create a new workbook, so it's really not much of a phantom.
But I don't have a guess why you're getting crashes.
===
Just some things to test...
Clean up the windows temp folder (can't hurt and sometimes helps)
Start excel in safe mode:
close excel
windows start button|Run
excel /safe
File|Open your workbook (macros will be disabled, though)
hit alt-f11 (to get to the vbe)
hit ctrl-g (to see the immediate window)
type this and hit enter:
Sheets("sheet1").Copy
Does it crash excel?
===
One more question: Does this happen on all pc's (if you can test)?
I don't have any guesses (no matter what your responses), but maybe someone else
will.
Dan Williams wrote:
I just tried it with manual calculation permanently on, and it still
happens.
After posting this, I discovered that if you DON'T interrupt it, the
over-simplified statement "Sheets("sheet1").Copy" actually copies the
sheet into a newly-created Book2. This hints at where the phantom
Book2 may come from.
But the same thing does happen when you interrupt copying within the
workbook, e.g.,
Sheets("sheet1").Copy befo=Worksheets(1)
It's almost as if interrupting this statement makes processing stop
after the "Copy" and before the "befo=" and it aborts in such a way
as to sort of half-create Book2.
--
Dave Peterson
|