ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   macro button (https://www.excelbanter.com/excel-programming/316499-macro-button.html)

tim

macro button
 
Hello All,

I was just showing someone how to record a macro and
experienced a strange problem. We
recorded "paste_special_values" using a shortcut key and
a macro button. The macro runs fine if you use the
shortcut key or the macro button, but when i try to run
the macro using the "Run" button a get an
error "PasteSpecial method of Range class failed".

Selection.PasteSpecial Paste:=xlValues,Operation:=xlNone,
SkipBlanks:= _
False, Transpose:=False

Any ideas?

Tom Ogilvy

macro button
 
When you run the macro using run, it clears the clipboard, so there is
nothing in the clipboard to paste.

--
Regards,
Tom Ogilvy


"Tim" wrote in message
...
Hello All,

I was just showing someone how to record a macro and
experienced a strange problem. We
recorded "paste_special_values" using a shortcut key and
a macro button. The macro runs fine if you use the
shortcut key or the macro button, but when i try to run
the macro using the "Run" button a get an
error "PasteSpecial method of Range class failed".

Selection.PasteSpecial Paste:=xlValues,Operation:=xlNone,
SkipBlanks:= _
False, Transpose:=False

Any ideas?




tim

macro button
 
Is there a reason for this? I can work around it without
a problem.....just curious.

Thanks


-----Original Message-----
When you run the macro using run, it clears the

clipboard, so there is
nothing in the clipboard to paste.

--
Regards,
Tom Ogilvy


"Tim" wrote in

message
...
Hello All,

I was just showing someone how to record a macro and
experienced a strange problem. We
recorded "paste_special_values" using a shortcut key

and
a macro button. The macro runs fine if you use the
shortcut key or the macro button, but when i try to run
the macro using the "Run" button a get an
error "PasteSpecial method of Range class failed".

Selection.PasteSpecial

Paste:=xlValues,Operation:=xlNone,
SkipBlanks:= _
False, Transpose:=False

Any ideas?



.


Tom Ogilvy

macro button
 
If you want reasons, you will have to ask microsoft.

--
Regards,
Tom Ogilvy

"Tim" wrote in message
...
Is there a reason for this? I can work around it without
a problem.....just curious.

Thanks


-----Original Message-----
When you run the macro using run, it clears the

clipboard, so there is
nothing in the clipboard to paste.

--
Regards,
Tom Ogilvy


"Tim" wrote in

message
...
Hello All,

I was just showing someone how to record a macro and
experienced a strange problem. We
recorded "paste_special_values" using a shortcut key

and
a macro button. The macro runs fine if you use the
shortcut key or the macro button, but when i try to run
the macro using the "Run" button a get an
error "PasteSpecial method of Range class failed".

Selection.PasteSpecial

Paste:=xlValues,Operation:=xlNone,
SkipBlanks:= _
False, Transpose:=False

Any ideas?



.





All times are GMT +1. The time now is 07:39 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com