Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default macro with paste special returns error

Perhaps I'm just stupid today - this seems like it should be simple
enough, but nothing has worked so far. Can anyone tell me what I
missing?

On worksheet one I have run a macro that hides rows, selects a range
and copies visible cells to the clipboard.

On worksheet two I am trying to run a recorded macro that does a paste
special, values and transpose. The recorded macro does not work, I've
tried a number of variations (even changed my security level) and
nothing is getting me any closer.


Here's the code for the macro

test7 Macro
' Macro recorded 3/22/2007 by afox
'
'
Windows("Daily News Column to pages.xls").Activate
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=True

End Sub


here's the result when I run it:


run-time error 1004

"Paste special method of range class failed"


I would appreciate any help, or even just a clue to point me in the
right direction.

Thanks in advance

Andy

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default macro with paste special returns error

Runs for me. Make sure nothing is clearing CutoCopyMode.

You might add this before the paste special:

MsgBox (Application.CutCopyMode = xlCopy)

--
Jim
"green fox" wrote in message
ups.com...
| Perhaps I'm just stupid today - this seems like it should be simple
| enough, but nothing has worked so far. Can anyone tell me what I
| missing?
|
| On worksheet one I have run a macro that hides rows, selects a range
| and copies visible cells to the clipboard.
|
| On worksheet two I am trying to run a recorded macro that does a paste
| special, values and transpose. The recorded macro does not work, I've
| tried a number of variations (even changed my security level) and
| nothing is getting me any closer.
|
|
| Here's the code for the macro
|
| test7 Macro
| ' Macro recorded 3/22/2007 by afox
| '
| '
| Windows("Daily News Column to pages.xls").Activate
| Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
| SkipBlanks _
| :=False, Transpose:=True
|
| End Sub
|
|
| here's the result when I run it:
|
|
| run-time error 1004
|
| "Paste special method of range class failed"
|
|
| I would appreciate any help, or even just a clue to point me in the
| right direction.
|
| Thanks in advance
|
| Andy
|


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default macro with paste special returns error

Running the macro clears the clipboard, so there is nothing to paste and you
get an error.

--
Regards,
Tom Ogilvy


"green fox" wrote:

Perhaps I'm just stupid today - this seems like it should be simple
enough, but nothing has worked so far. Can anyone tell me what I
missing?

On worksheet one I have run a macro that hides rows, selects a range
and copies visible cells to the clipboard.

On worksheet two I am trying to run a recorded macro that does a paste
special, values and transpose. The recorded macro does not work, I've
tried a number of variations (even changed my security level) and
nothing is getting me any closer.


Here's the code for the macro

test7 Macro
' Macro recorded 3/22/2007 by afox
'
'
Windows("Daily News Column to pages.xls").Activate
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=True

End Sub


here's the result when I run it:


run-time error 1004

"Paste special method of range class failed"


I would appreciate any help, or even just a clue to point me in the
right direction.

Thanks in advance

Andy


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default macro with paste special returns error

On Mar 22, 9:19 am, Tom Ogilvy
wrote:
Running the macro clears the clipboard, so there is nothing to paste and you
get an error.

--
Regards,
Tom Ogilvy



"green fox" wrote:
Perhaps I'm just stupid today - this seems like it should be simple
enough, but nothing has worked so far. Can anyone tell me what I
missing?


On worksheet one I have run a macro that hides rows, selects a range
and copies visible cells to the clipboard.


On worksheet two I am trying to run a recorded macro that does a paste
special, values and transpose. The recorded macro does not work, I've
tried a number of variations (even changed my security level) and
nothing is getting me any closer.


Here's the code for the macro


test7 Macro
' Macro recorded 3/22/2007 by afox
'
'
Windows("Daily News Column to pages.xls").Activate
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=True


End Sub


here's the result when I run it:


run-time error 1004


"Paste special method of range class failed"


I would appreciate any help, or even just a clue to point me in the
right direction.


Thanks in advance


Andy- Hide quoted text -


- Show quoted text -


Is there a way to assign the clipboard stuff to a variable, or a named
range (in the first macro) so the data could be retreived by the
second?

Andy

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default macro with paste special returns error

What I like to do is do the copy and paste as adjacent or as near as adjacent
commands in the code. I don't know what kind of functionality you want to
achieve so it is hard to suggest a workaround. I this is just a generalized
macro to do a pastespecial on whatever is in the clipboard, then I would
suggest using the built in menu button


Go to Tools=Customize, then select "commands" tab and in the left listbox
(Categories) select "Edit" and in the right listbox (Commands), select "Paste
Values". Drag this to the the toolbar of choice. Close the Customize
Dialog box.

--
Regards,
Tom Ogilvy




"green fox" wrote:

On Mar 22, 9:19 am, Tom Ogilvy
wrote:
Running the macro clears the clipboard, so there is nothing to paste and you
get an error.

--
Regards,
Tom Ogilvy



"green fox" wrote:
Perhaps I'm just stupid today - this seems like it should be simple
enough, but nothing has worked so far. Can anyone tell me what I
missing?


On worksheet one I have run a macro that hides rows, selects a range
and copies visible cells to the clipboard.


On worksheet two I am trying to run a recorded macro that does a paste
special, values and transpose. The recorded macro does not work, I've
tried a number of variations (even changed my security level) and
nothing is getting me any closer.


Here's the code for the macro


test7 Macro
' Macro recorded 3/22/2007 by afox
'
'
Windows("Daily News Column to pages.xls").Activate
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=True


End Sub


here's the result when I run it:


run-time error 1004


"Paste special method of range class failed"


I would appreciate any help, or even just a clue to point me in the
right direction.


Thanks in advance


Andy- Hide quoted text -


- Show quoted text -


Is there a way to assign the clipboard stuff to a variable, or a named
range (in the first macro) so the data could be retreived by the
second?

Andy




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
Paste Special throwing an error jlclyde Excel Discussion (Misc queries) 0 September 16th 08 03:48 PM
Special Paste Error...Data pastes into one column School Excel Discussion (Misc queries) 1 October 17th 07 06:48 PM
When paste special links the file name gives error Engineering Accountant Excel Discussion (Misc queries) 2 September 27th 06 10:05 PM
Cut and Paste using Macro gives paste special method error Lourens Pentz Excel Programming 3 November 21st 04 10:42 PM
Dynamic Copy/Paste Special Formulas/Paste Special Values Sharon Perez Excel Programming 3 August 7th 04 09:49 PM


All times are GMT +1. The time now is 04:02 PM.

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"