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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top