Home > OS >  locked textbox property set to true at worksheet
locked textbox property set to true at worksheet

Time:11-20

Hello i have textboxes (activeX control) at my worksheet and i have set its locked to true from property tab but it seems its not working at all the only way to prevent value in those textboxes being changed manually was to set the enable to false but i can't change the font color to black. does anyone has suggestions?

thanks before.

enter image description here

this is code have used so far

Private Sub locktextboxes()

Dim NamaBarangTextBox As Object
Set NamaBarangTextBox = Sheet1.NamaBarang

With NamaBarangTextBox
    .Locked = True
End With

End Sub

CodePudding user response:

I cannot explain what is the meaning of NamaBarangTextBox.Locked (obviously the property exists, else you would get a runtime error), but to set the box to readOnly, you need to access the locked-(sub)property of the Object-property:

Try

With NamaBarangTextBox.object
    .Locked = True
End With
  • Related