LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Interrupted sheet copying causes phantom Book2

Run this with a sheet1 that has enough calculations to make the copying
non-instantaneous.

Sheets("sheet1").Copy

If you press ESC quickly enough during the copying, you get a
not-surprising error: "Copy method of Worksheet class failed." That's
fine.

However, if sheet1 has a pie chart in it, then the next time you exit
from Excel, you get:

"Do you want to save the changes you made to 'Book2'?"

and if you naively say "Yes," Excel crashes. (And if you've tested it
several times before exiting, it also asks you about Book3, Book4,
etc.)

When I trap the ESC key, the trapping works fine, but the same error
happens when I exit Excel anyway.

I was building a mechanism to allow users to interrupt a tiresome loop,
but this makes me afraid to suggest using the ESC key at all. They
could lose stuff in other open workbooks.

I'm guessing I'm just going to have to live with this. Perhaps I'll
have to re-assemble the pie chart after each copy. But I thought I'd
at least document it.

Dan Williams
<danwPlanet

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Book1 and Book2 JohnR Excel Discussion (Misc queries) 2 July 6th 07 02:10 AM
=SUMIF(book2!L3:AF3, "=book1!O30", book2!L20:AF20) dond Excel Discussion (Misc queries) 1 November 8th 05 12:33 PM
opens to Book2 maryj Excel Discussion (Misc queries) 0 April 13th 05 03:09 PM
Copying Book1 to Book2 without selecting Robert Christie[_3_] Excel Programming 1 October 27th 04 10:25 AM
run macro in book1 from book2 - how? billy Excel Programming 1 December 18th 03 05:59 PM


All times are GMT +1. The time now is 08:17 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"