ActiveX Control (TextBox) question

S

Stuart

Using Excel 2000.

The textbox is embedded directly into the sheet.
When the workbook (with its single sheet) is opened,
the textbox is visible and accessible to the user.

Can I control access to the textbox, so that it is
only accessible under certain conditions?

For example, in the ThisWorkbook module I have
code in the Workbook_Open Event. Can I do
something like:
If ContractMaster = True Then
Enable the Contol
Else
User cannot edit the textbox

Is this possible please?

Regards.
 
N

Norman Jones

Hi Stuart,

To hide the textbox,try:

ActiveSheet.OLEObjects("Textbox1").Visible = True

To prevent editing, try:

ActiveSheet.OLEObjects("Textbox1").Enabled = True
 
S

Stuart

Many thanks.

Will give them a go.

Regards.

Norman Jones said:
Hi Stuart,

To hide the textbox,try:

ActiveSheet.OLEObjects("Textbox1").Visible = True

To prevent editing, try:

ActiveSheet.OLEObjects("Textbox1").Enabled = True
 
Top