[Fix] Excel UserForm Appears Shorter and Narrower Than Previous Versions

Assuming you’re working on Excel 2016, and you set the Height and Width properties of a UserForm from a program, and inside Excel, that UserForm appears shorter and narrower compared to earlier versions of Excel. You’ll notice a difference in inside height and inside width, which looks shorter and narrower, and the right side and lower end of the window are getting cut or truncated. The only good thing you see is the control layout in the main area where the UserForm would look-alike as in previous versions of Excel. Because of this issue, some parts of the UserForm or controls get truncated too. This is a known issue by Microsoft and is caused because of the difference in border size calculations between Excel 2016 and in earlier versions of Excel.

[Fix] Excel UserForm Appears Shorter and Narrower Than Previous Versions

To fix this issue, you need to set specific height and width values for the UserForm based on the Excel version you’ll be, or you’re using. If you’ve plans to use Excel 2016, that’ll require you to specify larger height and width properties in Excel 2016.

Fix Excel UserForm Size

If you want to reproduce the error, so that you may make proper changes in sizes, follow below-given steps:

  1. Open a blank new workbook in the previous version of Excel 2016, like on Excel 2013.
  2. Now save this file by going to File tab, select Save As and then click Macro-Enabled Workbook (*.xlsm) in the Save As type box, type in any file name, and hit Save.
  3. Now, go to Developer Tab. If the Developer tab is not visible, do these steps:
    1. Go to File > Options
    2. Click Customize Ribbons
    3. Under the Main Tabs area, Check the tick box of Developer.
    4. Enabling Developer Tab Excel 2016
    5. Hit OK to close the Excel Options dialog box.
  4. Now, on the Developer tab, click Visual Basic to start the Visual Basic Editor.
  5. In the Project – VBAProject pane, do a right-click to open a shortcut menu, select Insert, and then click UserForm.
  6. When Toolbox opens, select any control and paste it near the right and lower borders of the UserForm.
  7. Click the UserForm object, and then select and drag the corner mark to expand the Userform size.
  8. Now, right-click on Project – VBAProject pane, right-click on UserForm1, and select View Code.
  9. Now follow these steps carefully:
    1. In the Object drop-down, select UserForm.
    2. In the Procedure drop-down, select Initialize.
    3. Add the following macro code in between the Initialize event lines:
    4. In the Project – VBAProject pane, do a right-click, select Insert, and then select Module.
    5. In Module1, type the following macro code:
  10. Visual Basic Editor Test Macro
  11. Go back to Excel, on the Developer Tab, click Macros in the Code group.
  12. Then click on Test macro and then hit Run. Now, you’ll find that the control you added in Step 6 would show up correctly. Verify the size of the window to compare later.
  13. Save the workbook somewhere and then open the same file in Excel 2016.
  14. Go to Developer Tab, click Macros in the Code group and click Run.

You’ll find the error of control being truncated, which was added in Step 6. Also, the size of the window would be narrower and shorter, not like what we defined in step 9.d. Now, knowing the difference will help you make size compatible with Excel 2016 until Microsoft fixes this issue.

RELATED ARTICLES

1 COMMENT

LEAVE A REPLY

Please enter your comment!
Please enter your name here