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: 419
Default Run-time error '1004': PasteSpecial method of Range class failed

Hello all,

I get this error (subject line) when I run the following code:



Sub PasteValuesTranspose()
Dim plngScrollRow As Long
Dim pintScrollColumn As Integer
Dim pclcCalc As XlCalculation

pclcCalc = Application.Calculation
Application.Calculation = xlCalculationManual

plngScrollRow = Application.ActiveWindow.ScrollRow
pintScrollColumn = Application.ActiveWindow.ScrollColumn

'*** The Error occurs on the following line ***
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks:=False, Transpose:=True

Application.ActiveWindow.ScrollRow = plngScrollRow
Application.ActiveWindow.ScrollColumn = pintScrollColumn

Application.Calculation = pclcCalc

End Sub




BUT I don't get the error when I run the following (notice the commented-out
lines):




Sub PasteValuesTranspose()
Dim plngScrollRow As Long
Dim pintScrollColumn As Integer
Dim pclcCalc As XlCalculation

' pclcCalc = Application.Calculation
' Application.Calculation = xlCalculationManual

plngScrollRow = Application.ActiveWindow.ScrollRow
pintScrollColumn = Application.ActiveWindow.ScrollColumn

Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks:=False, Transpose:=True

Application.ActiveWindow.ScrollRow = plngScrollRow
Application.ActiveWindow.ScrollColumn = pintScrollColumn

' Application.Calculation = pclcCalc

End Sub



Can anyone explain to me what is going on here?

Thanks for any help anyone can provide,

Conan Kelly



---------------------------
"Smokin' weed kills your brain cells. Drinkin' only screws up your
liver...ya got 2 a those."
- Earl Hickey (NBC's "My Name is Earl")


 
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) 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 pglufkin Excel Programming 3 October 26th 06 03:27 PM
runtime error 1004 pastespecial method of range class failed dreamz[_29_] Excel Programming 5 February 3rd 06 02:57 PM
Run-time error '1004' PasteSpecial Method of Range Class Failed Kevin G[_2_] Excel Programming 1 February 3rd 04 05:01 AM


All times are GMT +1. The time now is 10:36 AM.

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"