Solved

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

Posted on 2014-12-03
5
180 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 45

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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

762 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now