#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default 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   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding area codes only to phone numbers missing an area code RC Excel Discussion (Misc queries) 5 May 3rd 23 05:06 PM
Removing the print area dost from the screen DubboPete Excel Discussion (Misc queries) 2 April 30th 09 03:42 PM
separate scroll bars for each area of split screen tobymaloby Excel Discussion (Misc queries) 1 July 14th 06 04:55 AM
print box opens in right screen of dual screen setup why gerrys Excel Discussion (Misc queries) 1 June 30th 06 06:47 PM
Need to convert point on screen to various screen resolutions Donna YaWanna Excel Discussion (Misc queries) 5 October 26th 05 10:10 PM


All times are GMT +1. The time now is 12:59 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"