PDA

View Full Version : [SOLVED:] What determines the size of the userform other than screen resolution?



mobucl
10-06-2017, 04:34 AM
Hi all,

Reading information from various places i understand that the size of the userform is usually determined by the screen resolution of the monitor. However in an application i am developing i have witnessed the userform appearing oversized on another computer which has exactly the same resolution setting as the one i am developing on.

This has leads to the question as to why? What is being used to determine the useform size if it is not resolution?

thanks

Matt

Aflatoon
10-06-2017, 05:10 AM
Probably the dpi setting?

mobucl
10-06-2017, 06:41 AM
Ok thanks - is the DPI setting usually used by excel to determine userform size rather than resolution? How can i get this information feed into VBA. I can then use one of the autosize functions thats out there to change the useform size.

Thanks

Matt

Aflatoon
10-06-2017, 06:54 AM
You can use API calls like this: https://www.pcreview.co.uk/threads/how-to-determine-the-dpi-setting-for-current-user.2521177/

mobucl
10-12-2017, 01:38 AM
Great thanks Aflatoon, i will give this a go!