View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
nxqviet nxqviet is offline
external usenet poster
 
Posts: 14
Default Copy Selection doesn't work

Hi all,

I have a macro that contains this following code. This is a very basic
copy code that copy a selection in Excel and Pates it to an opened
MS.Word application at a specified bookmark. This very long macro
works fine 80% of the time, but once in a while, the script would just
skip right over the Selection.copy part and then promt an error at the
Pates part, since the clipboard is indeed empty....

Application.Goto ("RangeA")
Range("RangeA").Select
Selection.Copy
WRD.Selection.Goto what:=wdGoToBookmark, Name:="BMarkA"
WRD.Selection.Paste

When debugging the error, i see that RangeA was selected, but never
copied (no flashing border around it). Then, I would just drag the
Yellow Arror back to the Application.Goto part, and make it repeat the
script, it would work fine. This error only happen once in a while, I
don't understand. Could it be the code? Could it be the memory? Please
help.

Thank you very much for you time and your help,

V_