Solved

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

Posted on 2014-12-03
5
225 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 30

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

724 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