Solved

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

Posted on 2014-12-03
5
212 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 47

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

763 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