Locking design mode, VBA and textboxes

Submeg

New Member
Joined
Sep 25, 2009
Messages
26
Hello all,

I have created a calculator which predicts a value depending on other values entered by the user.

The user first select a day from a drop down combobox (form control, not active x). They then select the number of days from another form control combox box. After pressing an ActiveX Command Button, a module calculates what days are affected (for example, if the user selects "Wednesday" and the length of 3 days, the days activated are: Wednesday, Thursday and Friday)

These strings are then displayed in ActiveX Textbox that the user cannot enter data into. The user then enters minimum and maximum temperatures for those days in other ActiveX Textboxes which have not been disabled. After pressing another ActiveX Command Button, the modules calculate a number depending on the number of days, temperatures etc...

My question is this. I have protected the sheet from users entering data into cells, I have stopped them from opening VBA, but I also want to stop them from shifting a textbox that I have on the page and from entering designmode.

I have tried to protect the sheet, but in doing so, it stops the user from selecting any of the values in the dropdown combo boxes.

I also trying to lock the design mode buttons using:

CommandBars("Visual Basic").Controls("Design Mode").Enabled = False
CommandBars("Control Toolbox").Controls("Design Mode").Enabled = False

On opening the the workbook. However, excel returns:

"Run-time error '91': Object variable or With block variable not set."

Any ideas on how to solve these? Cheers!!
 

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,224,616
Messages
6,179,911
Members
452,949
Latest member
beartooth91

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