ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Disable Option in Como Box (https://www.excelbanter.com/excel-programming/342958-disable-option-como-box.html)

ExcelMonkey

Disable Option in Como Box
 
I have a combo box with two items in it. Is it possible to load both items
but restric access to only one of them. For examle below you can see that I
have two items. I want the user to see both but I want to disable access to
the second one. That is I want the user to know the option will be there
evenutally but now now. What I am really asking is does the item have an
enabled property? Thanks


With MainUserForm.DisplayResultsCmbBx
.AddItem "As New Worksheet in This Excel File"
.AddItem "As Worksheet in New Excel File"
End With

Tom Ogilvy

Disable Option in Como Box
 
No.

--
Regards,
Tom Ogilvy

"ExcelMonkey" wrote in message
...
I have a combo box with two items in it. Is it possible to load both

items
but restric access to only one of them. For examle below you can see that

I
have two items. I want the user to see both but I want to disable access

to
the second one. That is I want the user to know the option will be there
evenutally but now now. What I am really asking is does the item have an
enabled property? Thanks


With MainUserForm.DisplayResultsCmbBx
.AddItem "As New Worksheet in This Excel File"
.AddItem "As Worksheet in New Excel File"
End With




Cush

Disable Option in Como Box
 
A work around might be something along the lines of:

With MainUserForm.DisplayResultsCmbBx
..AddItem "As New Worksheet in This Excel File"
..AddItem "As Worksheet in New Excel File (Disabled)"
End With

Then add a msgbox to the CmbBx_Click event if the user selects item 2
telling the user that it is temporarily not available

Then use another event driven macro to delete item 2 and replace it
with your original item 2 when it is appropriate.

This is a bit awkward but may be a "next best" way for you.

"ExcelMonkey" wrote:

I have a combo box with two items in it. Is it possible to load both items
but restric access to only one of them. For examle below you can see that I
have two items. I want the user to see both but I want to disable access to
the second one. That is I want the user to know the option will be there
evenutally but now now. What I am really asking is does the item have an
enabled property? Thanks


With MainUserForm.DisplayResultsCmbBx
.AddItem "As New Worksheet in This Excel File"
.AddItem "As Worksheet in New Excel File"
End With



All times are GMT +1. The time now is 08:50 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com