Forum Discussion
Ezio-de-Pazzi
Dec 02, 2022Brass Contributor
UserForms are getting strange, please help.
This must be the weirdest phenomenon I've ever faced. Normally in Userform.ListBox.Font.Italic should works just like a range. Private Sub UserForm_Initialize()
'this would works as expected
Us...
- Dec 02, 2022Gosh, I finally figured it out.
Turns out it all comes from the 64-bit Office. I tried to uninstall my office then reinstall 32-bit and it works PERFECTLY. >_<
I mean, come on Microsoft. It's 2022, I've been deploying 64-bit office to my colleague since 2016. And I don't regret it at all cause 64bit is sensible faster than 32bit to my workflow.
Guess the best workaround would be Call .font. Italic = false at others module. Thanks for your response ~
HansVogelaar
Dec 02, 2022MVP
I cannot reproduce the problem. Even if I don't call fixed, the listbox font is not italic when I show UserForm2 and UserForm3.
I'm using Excel in Office 2021 on Windows 11. Which version of Office and which operating system do you use?
Ezio-de-Pazzi
Dec 02, 2022Brass Contributor
What!
i have 3 devices, Windows 10 with Office 2016, Windows 10 with Office 2021, Windows 7 with Office 2010. All of them behaves the same issue ....
here's a footage....
- HansVogelaarDec 02, 2022MVP
Oh, I don't doubt your experience at all. I've seen more than enough weird behavior...
- Ezio-de-PazziDec 02, 2022Brass ContributorGosh, I finally figured it out.
Turns out it all comes from the 64-bit Office. I tried to uninstall my office then reinstall 32-bit and it works PERFECTLY. >_<
I mean, come on Microsoft. It's 2022, I've been deploying 64-bit office to my colleague since 2016. And I don't regret it at all cause 64bit is sensible faster than 32bit to my workflow.
Guess the best workaround would be Call .font. Italic = false at others module. Thanks for your response ~- mtarlerDec 02, 2022Silver Contributor
Ezio-de-Pazzi that is odd behavior indeed. Another option that seems to work is to perform the italic operation BEFORE the problem causing actions:
Private Sub UserForm_Initialize() 'this will NOT works! Just because i assigned a range variable. HOW STRANGE 'Notice the list is stil italic even if i set .Italic = False Dim test_rng As Range UserForm2.ListBox1.RowSource = "Sheet1!A1:A3" UserForm2.ListBox1.Font.Italic = True UserForm2.ListBox1.Font.Italic = False Set test_rng = [b5] 'MsgBox UserForm2.ListBox1.Font.Italic 'you can uncomment this line to check .Italic property, it's still TRUE Call fixed 'And this would just fixed? by assign the property in other module? >_< End Subnotice I moved those 3 lines ABOVE the Set statement and it seems to work fine here and in the other case too