#1
|
||||
|
||||
Userform dimensions suddenly exaggerated
This is the weirdest behavior I've ever seen in >15 years of VBA. All of the userforms in my largest Word add-in suddenly now display at vastly more than their intended width and with a varying amount of extra height.
All controls are proportionally elongated horizontally, but not vertically. (So there's a chunk of extra dead space at the bottom of the form, but none on the side.) The extreme width ranges from double to quintuple the design width, and is visible both in the VBE and when the form is run. But the added height (which is not nearly as extreme, typically an inch or so) is seen only when the form is run. Adjusting a form's width explicitly in the Activate event (Me.Width = xxx) restores normal proportions to all controls no matter what width is specified. That is, I can get normal appearance by adding Width and Height specs and then fudging the intended dimensions by trial & error. Clearly that's not a fix. (This add-in has over 30 userforms.) The screenshots attached illustrate. Sorry for the resizing, but the original dimensions of the uncorrected one would make the post's window a scrolling nightmare. Notice the shape of the buttons on right in the ridiculous image vs. the nonridiculous images. The actual displayed width of the former is more than 4x that of the latter. This happens on various PCs with different video card and monitor setups, so obviously it's not a hardware thing. Where do I even start? Grateful for any clues. Mark |
#2
|
||||
|
||||
Without actually seeing the problem userform, it can be difficult for anyone to diagnose the issue. Can you attach a document to a post with the userform and some representative data (delete/obfuscate anything sensitive)? You do this via the paperclip symbol on the 'Go Advanced' tab at the bottom of this screen.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
||||
|
||||
Thanks in advance, Paul. I'm uploading a .dotm file with one of the userforms, as well as a screenshot of what it's supposed to look like when its proportions aren't out of whack.
This happens to be one of the (physically) largest UFs, but the problem shows up in all of the forms in the add-in, and they vary widely in size/shape. I also just today noticed the same symptoms in the UFs in one of my Excel add-ins. The affected Word add-in is one that gets used, and edited, a lot; but the affected Excel add-in is used only rarely and hasn't been changed in several months. I really appreciate you taking a look. Mark |
#4
|
||||
|
||||
I suggest you check the userforms' specified heights & widths; the one you uploaded is set to 631.5 points (~8.77in) high & 2334 points (~32.42in) wide. Unless there's some obscure form of file corruption at work, the most likely explanation is that someone has edited the userform dimensions.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#5
|
||||
|
||||
Yes, that I knew. Sorry, I guess I wasn't clear at first. All the forms have had their properties altered, but nobody has access to my PC and that's the only place they're ever edited. Also, nobody in my organization understands even the most basic concepts about VBA. If this is malware, it seems like a seriously pointless payload.
And beyond the fact of the forms being resized is the question of how their controls, which were also resized, can be restored to their original dimensions & proportions just by changing the form's width in the Properties window (by any amount). That doesn't jive with my long experience creating and modifying userforms. I've kind of surrendered right now & written macros to correct all forms' dimensions if this happens again. But I was hoping for some clue to why it happened at all. |
#6
|
||||
|
||||
I haven't ever seen a userform change size by itself so I don't think it is a common problem.
Has the document been opened and saved from a Mac? The sizing differences between PC and Mac versions of Word 'might' be a factor.
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#7
|
||||
|
||||
Hi Andrew. No, it's never been touched by a Mac.
I've never seen it happen before either. And even if I could've done it accidentally (with what would've had to be an insanely long inadvertent mouse-drag, I guess), it's impossible to think I could've done it to all 30+ userforms in the file.... |
Tags |
userform |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
True 4:3 background dimensions | a_gunslinger | PowerPoint | 1 | 11-28-2016 08:22 PM |
Drawing room layouts with dimensions | Jeff Fenerty | Drawing and Graphics | 4 | 01-01-2016 07:13 PM |
VBA Code in a UserForm module to delete a Command Button which opens the userform | Simoninparis | Word VBA | 2 | 09-21-2014 03:50 AM |
Command button to show userform suddenly stopped working | jpb103 | Word VBA | 0 | 05-22-2014 06:05 AM |
Page dimensions are changing in word 2003 | OldFashionedOutlookUser | Word | 4 | 05-15-2012 02:44 PM |