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
Solved

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

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

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…
Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
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…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …

809 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