Macro - Insert code to ThisWorkbook

Studynot

New Member
Joined
Dec 30, 2009
Messages
3
Hi all,

I'm having an issue and I don't know how to start. There is a workbook that our company sends out to outside parties and we would like to prevent those people from cutting/copy/paste. This workbook is a data dump from our ERP system that then runs through a fairly complex macro to do all the necessary formatting and get the information into a readable format.

I would like to insert vba code into the macro that is already run on the raw data that will do the following:

  1. Insert a Module into the "ThisWorkbook" Class for the workbook it's running on
  2. Have that Module populate with a Private Sub that activates on opening the workbook and deactivates if you switch to a different workbook or close this workbook
  3. The Private Sub would disable the cut/copy/paste functionality related to Keyboard shortcuts, menu bar, & right click context menus
I have done some google searches that come up with code to insert a module, but everytime I try and execute those it pops up with the "Choose a Macro to run" window. If I choose one it simply runs that macro's code...

Thanks in advance for help on this!!

Let me know if there is any clarification required!
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)

Forum statistics

Threads
1,214,998
Messages
6,122,638
Members
449,093
Latest member
Ahmad123098

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