How to disable shape copy paste with vba in worksheet - please check this

Akanjana

Board Regular
Joined
Mar 22, 2020
Messages
104
Office Version
  1. 2016
Platform
  1. Windows
i have few flowchart shapes in excel sheet. which i use for label designing purpose. but i don't want to allow user to copy paste selected shape object in same worksheet.

VBA Code:
Application.copyObjectsWithCells = False

Application.CutCopyMode = False


daAFw.png



The reasons for not allowing copy paste to users are as follows:
1) on shape copy paste the name of shape is not getting changed
2) with two shapes with same name, i can not target shape selection with .onaction "macro" assigned to shape.


Excepting following solutions:
1) either to disable shape copy paste and allow shape formatting or
2) rename pasted shape with unique name.
3) any better solution from your end.

Help is highly appreciated. Thank You in advance.
 
In your code above i can't find "ShapeA_Click" marco codes and details. anyway
I wrote that it was not required for the illustration - I am only showing you what can be done :)
 
Upvote 0

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
My code does virtually everything you need in that case
If choosing shape names sequentially, VBA must test that the name does not already exist to prevent other issues

Your requirement is that the shape name must be different to any other shape on the sheet
What is your naming convention for each new shape?
 
Upvote 0

Forum statistics

Threads
1,224,885
Messages
6,181,587
Members
453,055
Latest member
cope7895

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top