Protect only certain objects in a VBA code

SimenSikkeland

New Member
Joined
Sep 2, 2014
Messages
1
Hello all,

I have currently been implementing a VBA code allowing for the installation and VBA referencing of the "Solver".
This code runs when the workbook is opened. This code is the only code I have in the "ThisWorkbook" object, but I have a lot of code connected to each specified sheet.

In order to run the code regarding the "Solver" the VBA must be unprotected, and I have read a great deal regarding this matter, and came to the conclusion that using "SendKeys" was not an option for me.

So my question is: Is there a way to protect/hide the code in the different sheets, and still be able to have the VBA Project (or just "ThisWorkbook") unlocked in order for the "Solver" code run properly?

If anyone has some other suggestion to how this might be done, I am all ears! :)
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.

Forum statistics

Threads
1,223,881
Messages
6,175,161
Members
452,615
Latest member
bogeys2birdies

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