excel - How to identify if Windows is running on a Mac in a virtual machine - Stack Overflow

I know that when using Excel VBA, there can be a slight difference in how font sizes are rendered betwe

I know that when using Excel VBA, there can be a slight difference in how font sizes are rendered between a Windows and Mac system, due to the different operating system's handling of pixel density and font rendering. This leads to a noticeable difference in the appearance of the same font size on different platforms, even if the numerical value is identical; this is especially relevant when working with user forms or elements with precise sizing requirements.

This means text elements displayed on a Mac no longer fit frames or textboxes etc originally sized for a Windows environment. I can execute the compiler test “#If Mac Then…” to adjust the forms’ text size accordingly - and that's fine. However, Excel userforms running in Windows environment on a Mac inside a virtual machine also display slightly larger text because they're using the Mac's native pixel density and font rendering.

Is there any way using VBA to test whether Windows is running in a VM environment so that I can adjust the font size accordingly? I've searched Google without success perhaps someone here can help?

Normally I would use the compiler tests for Mac or Windows operating systems but I don't want to test for native Windows because I want reduce font sizes only on Mac devices.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745006181a4605796.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信