Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,071
Default PasteSpecial Error


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


  #2   Report Post  
Posted to microsoft.public.excel.programming
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,071
Default PasteSpecial Error


Joel
Thanks for that but the used range covers only about 20 columns. Also,
from my initial post, this program is running on about 10 computers
statewide and only 2 of them are producing this error. Otto
"Joel" wrote in message
...
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





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default PasteSpecial Error


I can't tell from the code what GreenButton and Dest are set to. If you are
using set c = FIND() the options may not be set properly. Find in VBA
depends on the FIND on the worksheet settings. You may want to check the
find options on the worksheet to make sure it is set the same on all PC's.

The recomendations are to set all options in the VBA code - lookin, lookat,
and matchcase.

You may want to add a message box for debugging
msgbox("Addr : " & Dest.address & vbcrlf & "Rows : " & Dest.rows & vbcr4lf & _
"Columns : " & Dest.columns)
"Otto Moehrbach" wrote:

Joel
Thanks for that but the used range covers only about 20 columns. Also,
from my initial post, this program is running on about 10 computers
statewide and only 2 of them are producing this error. Otto
"Joel" wrote in message
...
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






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,071
Default PasteSpecial Error


Joel
Greenbutton is any one of a number of green cells and a
Worksheet_SelectionChange macro takes action when one of those cells is
selected (clicked on). Dest is set to the first empty cell in a range of 10
cells. There is no "FIND" in this code. I had the 2 problem computer users
to run additional code as you suggest to validate GreenButton and Dest.
There is no problem with that. Thanks for your time. Otto
"Joel" wrote in message
...
I can't tell from the code what GreenButton and Dest are set to. If you
are
using set c = FIND() the options may not be set properly. Find in VBA
depends on the FIND on the worksheet settings. You may want to check the
find options on the worksheet to make sure it is set the same on all PC's.

The recomendations are to set all options in the VBA code - lookin,
lookat,
and matchcase.

You may want to add a message box for debugging
msgbox("Addr : " & Dest.address & vbcrlf & "Rows : " & Dest.rows & vbcr4lf
& _
"Columns : " & Dest.columns)
"Otto Moehrbach" wrote:

Joel
Thanks for that but the used range covers only about 20 columns.
Also,
from my initial post, this program is running on about 10 computers
statewide and only 2 of them are producing this error. Otto
"Joel" wrote in message
...
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










  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default PasteSpecial Error


Can the users modify the cells manually (entire range). Maybe it is a
priledge problem. right now I'm not sure if it is a clipboard problem of a
paste problem. The clipboard can ve view by going to worksheet menu View -
Task Pane. then on taskpane select the down arrow and select clipboard. The
last item that was copied should be at the top and you can manually select
the item and then try pasting in a new workbook. This may help isolate where
the problem is located.

"Otto Moehrbach" wrote:

Joel
Greenbutton is any one of a number of green cells and a
Worksheet_SelectionChange macro takes action when one of those cells is
selected (clicked on). Dest is set to the first empty cell in a range of 10
cells. There is no "FIND" in this code. I had the 2 problem computer users
to run additional code as you suggest to validate GreenButton and Dest.
There is no problem with that. Thanks for your time. Otto
"Joel" wrote in message
...
I can't tell from the code what GreenButton and Dest are set to. If you
are
using set c = FIND() the options may not be set properly. Find in VBA
depends on the FIND on the worksheet settings. You may want to check the
find options on the worksheet to make sure it is set the same on all PC's.

The recomendations are to set all options in the VBA code - lookin,
lookat,
and matchcase.

You may want to add a message box for debugging
msgbox("Addr : " & Dest.address & vbcrlf & "Rows : " & Dest.rows & vbcr4lf
& _
"Columns : " & Dest.columns)
"Otto Moehrbach" wrote:

Joel
Thanks for that but the used range covers only about 20 columns.
Also,
from my initial post, this program is running on about 10 computers
statewide and only 2 of them are producing this error. Otto
"Joel" wrote in message
...
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









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
PasteSpecial Error Otto Moehrbach[_2_] Excel Programming 6 February 26th 09 03:50 AM
Error on pastespecial -goss Excel Programming 2 October 2nd 08 06:44 PM
Error in PasteSpecial ? Corey Excel Programming 14 October 30th 06 06:10 AM
PasteSpecial error Robert Christie[_3_] Excel Programming 4 December 27th 04 10:37 PM
PasteSpecial Error sowetoddid[_14_] Excel Programming 3 April 28th 04 12:14 AM


All times are GMT +1. The time now is 01:16 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"