Disable editing on a spreadsheet control

threearabawys

New Member
Joined
Nov 23, 2014
Messages
34
Hello everybody


I have a form with an spreadsheet control on it, I need to disable cell editing and if possible selecting and removing... basically all forms of interaction with said form.. I only put it there for viewing however I'm feeding the control some code via the form_initialize sub and if I select protect sheet under the custom properties of the control I get an error because the code is trying to edit the control.

Any Ideas on how this can be achieved?


Thanks in advance :)
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
How did you protect it in the user interface?
I select the spreadsheet control and on the properties tab I click on the "..." besides the "(Custom) box, a "property pages" dialogue box pops up and from the I go into the protection tab and check the "protect active sheet" check box.
 
Upvote 0
Thank you but I get an error when trying to run the form... I did find a way to disable editing though ...

Private Sub Spreadsheet1_BeforeContextMenu(ByVal x As Long, ByVal y As Long, ByVal Menu As OWC11.ByRef, ByVal Cancel As OWC11.ByRef)
Cancel = True
End Sub

Private Sub Spreadsheet1_BeforeKeyDown(ByVal KeyCode As Long, ByVal Shift As Long, ByVal Cancel As OWC11.ByRef)
Cancel = True


End Sub




Private Sub Spreadsheet1_StartEdit(ByVal Selection As Object, ByVal InitialValue As OWC11.ByRef, ByVal Cancel As OWC11.ByRef, ByVal ErrorDescription As OWC11.ByRef)
Cancel = True
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,427
Messages
6,124,831
Members
449,190
Latest member
rscraig11

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