Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Screen Area
Is there a way to use VBA to retrieve (or set) the user's
screen area eg 800x600, 1024x768 etc. I am trying to format a file so that when the user opens it the graphs within it are displayed at almost full screen, but I don't want to put the charts on individual Charts sheets. Many thanks Tony M. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Screen Area
Try this in a normal module
It will change the zoom Declare Function GetSystemMetrics32 Lib "user32" Alias "GetSystemMetrics" (ByVal nIndex As Long) As Long Function DisplayVideoResolution() As String DisplayVideoResolution = GetSystemMetrics32(0) & " x " & GetSystemMetrics32(1) End Function Sub test() If DisplayVideoResolution = "1024 x 768" Then Zoom = 100 If DisplayVideoResolution = "800 x 600" Then Zoom = 80 If DisplayVideoResolution = "640 x 480" Then Zoom = 50 ActiveWindow.Zoom = Zoom End Sub -- Regards Ron de Bruin (Win XP Pro SP-1 XL2002 SP-2) www.rondebruin.nl "Tony M" wrote in message ... Is there a way to use VBA to retrieve (or set) the user's screen area eg 800x600, 1024x768 etc. I am trying to format a file so that when the user opens it the graphs within it are displayed at almost full screen, but I don't want to put the charts on individual Charts sheets. Many thanks Tony M. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Screen Area
Thanks Ron, that worked perfectly.
Tony M. -----Original Message----- Try this in a normal module It will change the zoom Declare Function GetSystemMetrics32 Lib "user32" Alias "GetSystemMetrics" (ByVal nIndex As Long) As Long Function DisplayVideoResolution() As String DisplayVideoResolution = GetSystemMetrics32(0) & " x " & GetSystemMetrics32(1) End Function Sub test() If DisplayVideoResolution = "1024 x 768" Then Zoom = 100 If DisplayVideoResolution = "800 x 600" Then Zoom = 80 If DisplayVideoResolution = "640 x 480" Then Zoom = 50 ActiveWindow.Zoom = Zoom End Sub -- Regards Ron de Bruin (Win XP Pro SP-1 XL2002 SP-2) www.rondebruin.nl "Tony M" wrote in message ... Is there a way to use VBA to retrieve (or set) the user's screen area eg 800x600, 1024x768 etc. I am trying to format a file so that when the user opens it the graphs within it are displayed at almost full screen, but I don't want to put the charts on individual Charts sheets. Many thanks Tony M. . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Adding area codes only to phone numbers missing an area code | Excel Discussion (Misc queries) | |||
Removing the print area dost from the screen | Excel Discussion (Misc queries) | |||
separate scroll bars for each area of split screen | Excel Discussion (Misc queries) | |||
print box opens in right screen of dual screen setup why | Excel Discussion (Misc queries) | |||
Need to convert point on screen to various screen resolutions | Excel Discussion (Misc queries) |