Please help with syntax Object - Range - & .PasteSpecial situation

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

An easy question for you, I presume.

I always get a error message claiming "object missing" and/or "error in
range class " etc. when I try to pastespecial.
What bloody object is missing???

Is it about something that pastespecial can be a worksheet object OR a range
object? I do not understand that exactly. I have tried using "With selection
..PasteSpecial End With approach also with same errors. Any sitting on a
clarification that even I understand? You see the code below.

Brief:
I have something in the clipboard I want to store it on
sheet200.Range("BB100").
The Calling of sub SetSaveLoc2 is storing WB, WS and Range to be able to
grab the clipboard content now stored in "BB100".
I "put the clipboard on shelf" because i think I have code in a Sub
Worksheet_activate event that wipe out the clipboard. Therefore do I have to
store the clipboard "on shelf" when I change sheets...

CODE:

Public Sub SaveClipBoard2()
'*****************************************
' SaveClipBoard2 save copy in Sheet200 as storageplace 2
'*****************************************

Sheet200.Unprotect
Sheet200.Select
Range("BB100").Select
Selection.PasteSpecial Paste:=xlPasteFormulas,
Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Call SetSaveLoc2 ' Make possible to find
paste "selection/size/area"

Sheet200.Protect AllowFormattingCells:=False
Sheet.EnableSelection = xlUnlockedCells

End Sub
 
There is nothing inherently wrong with your code. The PasteSpecial method
will fail of there is nothing to paste. If you have a concise and complete
example, including the Copy, that anyone can run and see fail, post it.


Should be Sheet200?

--
Jim Rech
Excel MVP
| An easy question for you, I presume.
|
| I always get a error message claiming "object missing" and/or "error in
| range class " etc. when I try to pastespecial.
| What bloody object is missing???
|
| Is it about something that pastespecial can be a worksheet object OR a
range
| object? I do not understand that exactly. I have tried using "With
selection
| .PasteSpecial End With approach also with same errors. Any sitting on a
| clarification that even I understand? You see the code below.
|
| Brief:
| I have something in the clipboard I want to store it on
| sheet200.Range("BB100").
| The Calling of sub SetSaveLoc2 is storing WB, WS and Range to be able to
| grab the clipboard content now stored in "BB100".
| I "put the clipboard on shelf" because i think I have code in a Sub
| Worksheet_activate event that wipe out the clipboard. Therefore do I have
to
| store the clipboard "on shelf" when I change sheets...
|
| CODE:
|
| Public Sub SaveClipBoard2()
| '*****************************************
| ' SaveClipBoard2 save copy in Sheet200 as storageplace 2
| '*****************************************
|
| Sheet200.Unprotect
| Sheet200.Select
| Range("BB100").Select
| Selection.PasteSpecial Paste:=xlPasteFormulas,
| Operation:=xlNone, _
| SkipBlanks:=False, Transpose:=False
| Call SetSaveLoc2 ' Make possible to find
| paste "selection/size/area"
|
| Sheet200.Protect AllowFormattingCells:=False
| Sheet.EnableSelection = xlUnlockedCells
|
| End Sub
|
|
 
Back
Top