You might not receive an email informing you that there is a new reply in a thread you are following. We are working on fixing this as fast as possible. Please make sure to periodically check the conversation to see if there are any updates.
October 31, 2024
Please note, the notification system in the Community is partially broken
You might not receive an email informing you that there is a new reply in a thread you are following. We are working on fixing this as fast as possible. Please make sure to periodically check the conversation to see if there are any updates.
October 14, 2024
Excel Top Contributors:
vba code to make invisible 'paste option' from the right click menu?
Report abuse
Thank you.
Reported content has been submitted
Hi,
try this..
Private Sub Workbook_Open()
Application.CommandBars("Cell").Controls("Paste Options:").Enabled = False
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.CommandBars("Cell").Controls("Paste Options:").Enabled = True
End Sub
Microsoft365 on Windows11
---------------------------------
Report abuse
Thank you.
Reported content has been submitted
Was this reply helpful?
Sorry this didn't help.
Great! Thanks for your feedback.
How satisfied are you with this reply?
Thanks for your feedback, it helps us improve the site.
How satisfied are you with this reply?
Thanks for your feedback.
Hi TasosK,
Thanks for the quick reply.
But the above code is not worked am getting the below error when debegging.
Invalid procedure call or argument.
Report abuse
Thank you.
Reported content has been submitted
Was this reply helpful?
Sorry this didn't help.
Great! Thanks for your feedback.
How satisfied are you with this reply?
Thanks for your feedback, it helps us improve the site.
How satisfied are you with this reply?
Thanks for your feedback.
No,
place this code in BeforeClose event
and not in BeforeRightClick event
XXXXXXXXXXXX
double click on ThisWorkbook (in vba)
and paste in the below TWO Codes
Private Sub Workbook_Open()
Application.CommandBars("Cell").Controls("Paste Options:").Enabled = False
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.CommandBars("Cell").Controls("Paste Options:").Enabled = True
End Sub
Save - Close and re-open your WB
NOTE: THIS IS A TEMPORARY SOLUTION, ONLY FOR THIS WORKBOOK.
Microsoft365 on Windows11
---------------------------------
Report abuse
Thank you.
Reported content has been submitted
Was this reply helpful?
Sorry this didn't help.
Great! Thanks for your feedback.
How satisfied are you with this reply?
Thanks for your feedback, it helps us improve the site.
How satisfied are you with this reply?
Thanks for your feedback.
Report abuse
Thank you.
Reported content has been submitted
Was this reply helpful?
Sorry this didn't help.
Great! Thanks for your feedback.
How satisfied are you with this reply?
Thanks for your feedback, it helps us improve the site.
How satisfied are you with this reply?
Thanks for your feedback.
Hi,
Sorry, i haven't check the above codes.
because, i'm using xl2003
did you check if that works
for Cut, Copy ?
e.g
Private Sub Workbook_Open()
Application.CommandBars("Cell").Controls("Cut").Enabled = False
Application.CommandBars("Cell").Controls("Copy").Enabled = False
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.CommandBars("Cell").Controls("Cut").Enabled = True
Application.CommandBars("Cell").Controls("Copy").Enabled = True
End Sub
Microsoft365 on Windows11
---------------------------------
Report abuse
Thank you.
Reported content has been submitted
Was this reply helpful?
Sorry this didn't help.
Great! Thanks for your feedback.
How satisfied are you with this reply?
Thanks for your feedback, it helps us improve the site.
How satisfied are you with this reply?
Thanks for your feedback.
Hi TasosK
I have tried cut, copy code, its working but 'paste option:' code is not working.
Application.CommandBars("Cell").Controls("Paste").Enabled = False this is working in Excel 2007 but not in 2010.
In office 2010 they have newly introduced 'paste option:' instead of 'paste' . so please look the problem and provide the solution.
Id for paste is 22 like that if you know id for the "paste option:" please share
Thanks.
Report abuse
Thank you.
Reported content has been submitted
Was this reply helpful?
Sorry this didn't help.
Great! Thanks for your feedback.
How satisfied are you with this reply?
Thanks for your feedback, it helps us improve the site.
How satisfied are you with this reply?
Thanks for your feedback.
Report abuse
Thank you.
Reported content has been submitted
Was this reply helpful?
Sorry this didn't help.
Great! Thanks for your feedback.
How satisfied are you with this reply?
Thanks for your feedback, it helps us improve the site.
How satisfied are you with this reply?
Thanks for your feedback.
Hi,
i'm using xl2003
so,
i can't see the 'right click' options, of xl2010
but the problem is, that i can't test this code.
Microsoft365 on Windows11
---------------------------------
Report abuse
Thank you.
Reported content has been submitted
Was this reply helpful?
Sorry this didn't help.
Great! Thanks for your feedback.
How satisfied are you with this reply?
Thanks for your feedback, it helps us improve the site.
How satisfied are you with this reply?
Thanks for your feedback.
Report abuse
Thank you.
Reported content has been submitted
Was this reply helpful?
Sorry this didn't help.
Great! Thanks for your feedback.
How satisfied are you with this reply?
Thanks for your feedback, it helps us improve the site.
How satisfied are you with this reply?
Thanks for your feedback.
Hi,
i suppose that, someone in this forum
could solve the issue.
(maybe, without using an add-in)
TasosK
Microsoft365 on Windows11
---------------------------------
Report abuse
Thank you.
Reported content has been submitted
Was this reply helpful?
Sorry this didn't help.
Great! Thanks for your feedback.
How satisfied are you with this reply?
Thanks for your feedback, it helps us improve the site.
How satisfied are you with this reply?
Thanks for your feedback.
Question Info
Last updated July 18, 2020 Views 710 Applies to: