Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Paul,
Am Wed, 27 Jul 2016 10:59:29 -0700 (PDT) schrieb Paul Doucette: 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 try: Private Sub CommandButton2_Click() Application.ScreenUpdating = False Sheets("Sheet2").Shapes("Oval 2").Copy With Sheets("Sheet1") .Unprotect .Paste With .Shapes("Oval 2") .IncrementLeft -12.75 .IncrementTop -30.25 End With .Protect DrawingObjects:=False, Contents:=True, Scenarios:=True End With Application.ScreenUpdating = True End Sub Regards Claus B. -- Windows10 Office 2016 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Wednesday, July 27, 2016 at 1:59:49 PM UTC-4, Paul Doucette wrote:
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 Still hanging up at .Paste |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Paul,
Am Wed, 27 Jul 2016 11:39:49 -0700 (PDT) schrieb Paul Doucette: Still hanging up at .Paste in my workbook it is working fine. Try: Private Sub CommandButton2_Click() Application.ScreenUpdating = False Sheets("Sheet2").Shapes("Oval 2").Copy Sheets("Sheet1").Paste With Sheets("Sheet1") With .Shapes("Oval 2") .IncrementLeft -12.75 .IncrementTop -30.25 End With End With Application.ScreenUpdating = True End Sub Regards Claus B. -- Windows10 Office 2016 |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Wednesday, July 27, 2016 at 1:59:49 PM UTC-4, Paul Doucette wrote:
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 Just tried on a different machine, and it works fine there too. I'm thinking my server needs a restart. Sorry for bothering you, and thanks very much for pointing me in the right direction! -Paul |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Paste error | Excel Discussion (Misc queries) | |||
Error when doing a paste | Excel Programming | |||
Cut and Paste using Macro gives paste special method error | Excel Programming | |||
Code Error - Run Time Error 5 (Disable Cut, Copy & Paste) | Excel Programming | |||
Paste Error | Excel Programming |