Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Run-time error '1004' PasteSpecial Method of Range Class Failed

Hi,

I have a macro to copy a range from one sheet1 to sheet2. If a chart in
sheet2 is selected I get the following error.
Run-time error '1004' PasteSpecial Method of Range Class Failed

I would like to set up a error handling proceedure to either:
1) Notify user of chart being selected in sheet2 and then Exit Sub
or
2)Deselect chart in sheet2 and continue running macro

Can this be done?

Thanks, Kevin Graham


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 100
Default Run-time error '1004' PasteSpecial Method of Range Class Failed

Kevin

Activate the range in sheet2 you want to paste the data before doing the pastespecial
Something like
Range("a1:c1").Copy
Sheets("sheet2").Select
Range("a8").Activate
Range("a8").PasteSpecial Paste:=xlPasteValues
or
Range("a1:c1").Copy
Sheets("sheet2").Select
Range("a8").Select
Range("a8").PasteSpecial Paste:=xlPasteValues

Won't matter if the graph on sheet2 is selected or not as it will remove the focus.

Tony
----- Kevin G wrote: -----

Hi,

I have a macro to copy a range from one sheet1 to sheet2. If a chart in
sheet2 is selected I get the following error.
Run-time error '1004' PasteSpecial Method of Range Class Failed

I would like to set up a error handling proceedure to either:
1) Notify user of chart being selected in sheet2 and then Exit Sub
or
2)Deselect chart in sheet2 and continue running macro

Can this be done?

Thanks, Kevin Graham



Reply
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
Run-time error '1004': AutoFill method of Range class failed murkaboris Excel Discussion (Misc queries) 10 April 16th 09 09:06 PM
Run-time error '1004': AutoFill method of Range class failed murkaboris Excel Discussion (Misc queries) 3 April 14th 09 10:35 PM
Run-Time error '1004' : Select method of Range class failed [email protected] Excel Discussion (Misc queries) 3 March 9th 07 01:36 PM
Run-time error "1004" Select method of range class failed Tallan Excel Discussion (Misc queries) 3 March 7th 07 05:22 PM
error 1004 Select method of Range class failed J.E. McGimpsey Excel Programming 1 September 12th 03 07:42 PM


All times are GMT +1. The time now is 10:42 PM.

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

About Us

"It's about Microsoft Excel"