![]() |
Screen resolution
I have a 30 sheet Excel package that was designed on a
monitor using 800 x 600 resolution and most sheets have "Frozen Panes" to hide certain parts. It forces itself into Full Screen mode for maximum use of the screen. When it displays on a 1024 x 768 resolution monitor it shows rows and columns that should be out of sight. I don't want to use hide rows or columns as that makes modifying the package more complicated. Is there a way of detecting the screen resolution and zooming Excel to only show what it does in 800 x 600 resolution? |
Screen resolution
Hi
You can find the screen resolution with an API function: Private Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As Long Private Const SM_CXSCREEN = 0 Private Const SM_CYSCREEN = 1 Public Function GSR() As String GSR = CStr(GetSystemMetrics(SM_CXSCREEN)) & " x " & CStr(GetSystemMetrics(SM_CYSCREEN)) End Function Sub show() MsgBox "Current screen resolution is " & GSR, vbInformation End Sub HTH Regards Pascal "Arkimediz" a écrit dans le message de news: ... I have a 30 sheet Excel package that was designed on a monitor using 800 x 600 resolution and most sheets have "Frozen Panes" to hide certain parts. It forces itself into Full Screen mode for maximum use of the screen. When it displays on a 1024 x 768 resolution monitor it shows rows and columns that should be out of sight. I don't want to use hide rows or columns as that makes modifying the package more complicated. Is there a way of detecting the screen resolution and zooming Excel to only show what it does in 800 x 600 resolution? |
Screen resolution
Arkimediz,
Virtually all advanced Excel programming texts explain how to use the elementary APL GetSystemMetrics call to get the screen resolution. It takes the form vidWidth = GetSystemMetrics(SM_CXSCREEN) [For the height it is vidHeight = GetSystemMetrics(SM_CYSCREEN)] Once I have the vidwidth I can then expand my UserForms by multiplying the Zoom property of my UserForms by the factor vidWidth / 800 In your case you could try multiplying the column widths by the same factor. -- Dennis Eisen |
Screen resolution
Sub Zoom2Fit()
Columns("A:H").Select ActiveWindow.Zoom = True End Sub HTH. Best wishes Harald "Arkimediz" skrev i melding ... I have a 30 sheet Excel package that was designed on a monitor using 800 x 600 resolution and most sheets have "Frozen Panes" to hide certain parts. It forces itself into Full Screen mode for maximum use of the screen. When it displays on a 1024 x 768 resolution monitor it shows rows and columns that should be out of sight. I don't want to use hide rows or columns as that makes modifying the package more complicated. Is there a way of detecting the screen resolution and zooming Excel to only show what it does in 800 x 600 resolution? |
All times are GMT +1. The time now is 09:32 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com