Font size reducing by itself in a list box.

Posted on 2014-08-27
Last Modified: 2014-11-18
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.
Question by:mcgilvra
    LVL 33

    Expert Comment

    No screenshot I'm afraid.:)

    Where is the listbox located and how did you create it?
    LVL 76

    Expert Comment

    The font file on the particular machine might be damaged. How does that font appear in other contexts?
    LVL 44

    Expert Comment

    by:Martin Liss
    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.

    Author Comment

    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.
    LVL 44

    Expert Comment

    by:Martin Liss
    I assume that you chose the control at the arrow. If so then please see my previous post.
    ActiveX listbox

    Accepted Solution

    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
    LVL 44

    Expert Comment

    by:Martin Liss
    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.
    LVL 44

    Expert Comment

    by:Martin Liss
    This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    In case Office 2010 has not been deployed in your environment, this article may be quite useful. In our office, we wanted a way to deploy Microsoft Office Professional Plus 2010 through an automated batch file via logon script. This article is docum…
    Using Word 2013, I was experiencing some incredible lag when typing.  Here's what worked for me....
    This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    794 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

    16 Experts available now in Live!

    Get 1:1 Help Now