View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
external usenet poster
 
Posts: 9,101
Default PasteSpecial Error


You may be extedning beyond the number of columns in the worksheet



if Greenbutton.column + Greenbutton.columns - 1 <= (columns.count - 3) then
GreenButton.Offset(, 1).Resize(, 2).Copy
if Dest.Column + Greenbutton.columns - 1 <= columns.count then
Dest.PasteSpecial xlPasteValues
end if
end if

"Otto Moehrbach" wrote:

Excel 2002, 2003
I wrote a rather long program for an OP and he distributed it to about a
dozen branch offices in his state. Two of those offices are getting an
error in the PasteSpecial line below. The error is "PasteSpecial method of
range class failed."
The pertinent 2 lines of code are shown below. Note that "GreenButton" and
"Dest" are both one-cell ranges.
GreenButton.Offset(, 1).Resize(, 2).Copy
Dest.PasteSpecial xlPasteValues
The purpose I had in using "xlPasteValues" was to NOT copy the formatting.

Both of the problem computers have 2003 but so do most of the others. I
have 2002.
My thinking is that the problem lies in the setup of Excel on those 2
computers.
Any help would be appreciated. Thanks for your time. Otto