Thread: Error on paste
View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
GS[_6_] GS[_6_] is offline
external usenet poster
 
Posts: 1,182
Default Error on paste

This code has worked in the past for copying an oval shape with a
clear background from one sheet to another. (we use it to circle info
we wish to draw attention to). But it recently began to error at
Activesheet.Paste. Any thoughts on why that might be? Or a way to
fix, or do differently? Thanks in advance, Paul

Private Sub CommandButton2_Click()
Application.ScreenUpdating = False
Sheets("Sheet2").Select
ActiveSheet.Shapes("Oval 2").Select
Selection.Copy
Sheets("Sheet1").Select
ActiveSheet.unprotect
ActiveSheet.Paste
Selection.ShapeRange.IncrementLeft -12.75
Selection.ShapeRange.IncrementTop -30.25
Sheets("Sheet1").Select
ActiveCell.Offset(0, 4).Range("A1").Select
Sheets("Sheet1").Select
ActiveSheet.protect DrawingObjects:=False, Contents:=True,
Scenarios:=True Application.ScreenUpdating = True
End Sub


Why not just draw a new shape when/as needed?

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus