Solved

How do I control the caption text on a disabled Excel 2007 Activex control using VBA?

Posted on 2014-12-03
5
197 Views
Last Modified: 2014-12-14
I'm using Excel 2007 VBA to control the appearance of Activex controls (not Form controls - I know the difference).  When I disable an Activex command button or Activex text box the caption text is displayed in a medium gray color with what appears to be a white drop shadow.  I've spent hours Googling for a property that I can use to control this issue but to no avail.  I've checked the list of properties for the respective Activex controls on MSDN - no luck.

Does anyone know how to control the formatting of caption text when an Activex control have been diabled using VBA?

Thanks For Your Help,

Bill Vallance
0
Comment
Question by:bvallanc
5 Comments
 
LVL 46

Expert Comment

by:Martin Liss
ID: 40478510
Cut and paste the control into a frame that does not have a border. Make the frame the same size as the control. After that disable or enable the frame rather than the control.
0
 
LVL 29

Expert Comment

by:gowflow
ID: 40478524

Does anyone know how to control the formatting of caption text when an Activex control have been diabled using VBA?

Do you mean to say that when the button is disabled instead of seeing the normal white shadow and greyish writing you want to be able to change that behavior to something else ??

Gowflow
0
 
LVL 35

Expert Comment

by:Kimputer
ID: 40478543
You've done the correct research already! As you can see, there are no properties to tweak with, so your only option is to find another way to accomplish what you need (use pictures instead, reprogram anything you need), or live with the limitations of the activex controls.
0
 

Accepted Solution

by:
bvallanc earned 0 total points
ID: 40489075
Thanks, everyone, for responding to my question.

Through trial and error I happened to discover how the 'Enabled' property for Activex controls works when it is set to 'False.' The change in state from enabled to disabled changes the control's text (Caption) to a medium-gray color with a white drop shadow. I haven't found anything that can change this behavior. IT LOOKS UGLY ON EVERYTHING - EXCEPT - A BackColor OF &H00E0E0E0&! The RGB equivalent for this hex code is RGB(224,224,224). When this Light Grey BackColor is applied to the control, the appearance becomes that of sunken text in a greyed-out control - exactly what I was looking for.

I hope this simple fix helps someone else save time in the future!

Bill Vallance
0
 

Author Closing Comment

by:bvallanc
ID: 40498726
I found the solution myself.  None of the respondents had proposed what I discovered.  If they had I would have gladly accepted one of their answers as the solution.
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http:/Q_27311462.html), I created an alternative function to the Excel Concatenate() function that you might find useful.  I tested several solutions and share the results in this article as well as t…
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question