Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1870
  • Last Modified:

Font size reducing by itself in a list box.

We wrote a VBA app under Excel 2010. A particular user on an XP machine is seeing the font size in a list box reduced to almost unreadable size. The list box font property is set to Arial 12. Another user on an XP machine cannot replicate the problem. And the developer, myself, cannot reproduce it on a Win2007 machine. Attached is a screenshot of the reduced font list box.

Any help would be greatly appreciated, thanks.
1 Solution
NorieData ProcessorCommented:
No screenshot I'm afraid.:)

Where is the listbox located and how did you create it?
The font file on the particular machine might be damaged. How does that font appear in other contexts?
Martin LissRetired ProgrammerCommented:
I assume that the control is on a sheet and that you are using an ActiveX listbox rather than a forms listbox. If so that's a known problem when using ActiveX controls on a sheet which they really aren't designed for. On the other hand, the problem with using a forms listbox is that while the font size won't change, it is set at a small size that can't be changed. There's another option however which is described in my Magical Floating ActiveX Control article. And yes, it uses ActiveX controls but you won't experience the shrinking font problem because the listbox will be recreated each time.

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

mcgilvraAuthor Commented:
List box is located on a worksheet. List box was created from Controls (not forms). List box text entries are added via VBA code. I'll have to check on font appearance in other contexts. Screen shot is now attached.
Martin LissRetired ProgrammerCommented:
I assume that you chose the control at the arrow. If so then please see my previous post.
ActiveX listbox
mcgilvraAuthor Commented:
I am using an ActiveX Listbox on a sheet. I found a solution in another ExpertExchange article: "Dealing with unintended Excel Active-X resizing quirks (VBA code simulates "self correction")"

Here's the solution: set the ListBox IntegralHeight property to True, then back to False, then restore it's original Height and Width properties, this can all be done in code during initialization.

Here's my code for a ListBox named lbLogList:

    With Sheets("Graphs").lbLogList
        SaveHeight = .Height 'save original height and width
        SaveWidth = .Width
        .IntegralHeight = True 'set to an integral height, this will fix the shrinking text problem but make the box bigger.
        .IntegralHeight = False 'return to non-integral height
        .Height = SaveHeight  'restore original height and width
        .Width = SaveWidth
    End With
Martin LissRetired ProgrammerCommented:
I'll bet that after several clicks that while the size of the listbox will be restored that the size of the font will shrink.
Martin LissRetired ProgrammerCommented:
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now