Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Capturing Screen Size Help Needed!
Hi
How can I capture the screen size/resolution the monitor is set to from an excel macro Sincerely Uncapturable |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Capturing Screen Size Help Needed!
Eloy Argueso wrote:
How can I capture the screen size/resolution the monitor is set to from an excel macro? You'll need to use an api call, someone once sent me this piece of code that belongs to John Walkenbach: Declare Function GetSystemMetrics Lib "user32" _ (ByVal nIndex As Long) As Long Public Const SM_CXSCREEN = 0 Public Const SM_CYSCREEN = 1 Sub DisplayVideoInfo() vidWidth = GetSystemMetrics(SM_CXSCREEN) vidHeight = GetSystemMetrics(SM_CYSCREEN) Msg = "The current video mode is: " Msg = Msg & vidWidth & " X " & vidHeight MsgBox Msg End Sub I tried it and it works. Regards, -- Beto Reply: Erase between the dot (inclusive) and the @. Responder: Borra la frase obvia y el punto previo. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Capturing Screen Size Help Needed!
How come?
It Doesn't accepts SM_CXSCREEN and SM_CYSREEN as public members of objects on my XL2K. "Beto" wrote in message ... Eloy Argueso wrote: How can I capture the screen size/resolution the monitor is set to from an excel macro? You'll need to use an api call, someone once sent me this piece of code that belongs to John Walkenbach: Declare Function GetSystemMetrics Lib "user32" _ (ByVal nIndex As Long) As Long Public Const SM_CXSCREEN = 0 Public Const SM_CYSCREEN = 1 Sub DisplayVideoInfo() vidWidth = GetSystemMetrics(SM_CXSCREEN) vidHeight = GetSystemMetrics(SM_CYSCREEN) Msg = "The current video mode is: " Msg = Msg & vidWidth & " X " & vidHeight MsgBox Msg End Sub I tried it and it works. Regards, -- Beto Reply: Erase between the dot (inclusive) and the @. Responder: Borra la frase obvia y el punto previo. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Capturing Screen Size Help Needed!
Martyn wrote:
How come? It Doesn't accepts SM_CXSCREEN and SM_CYSREEN as public members of objects on my XL2K. I don't know. I just opened up a new workbook, created a new VBA module and copy-pasted the code from this thread. It worked without any trouble. I'm using Excel2002, but I think it shouldn't be different with Excel2000. Anyone else with Excel2000 having this problem??? Regards, -- Beto Reply: Erase between the dot (inclusive) and the @. Responder: Borra la frase obvia y el punto previo. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Screen Size | Excel Worksheet Functions | |||
Screen Size ? | New Users to Excel | |||
change font size on screen, but prints in old size | Excel Discussion (Misc queries) | |||
Work sheet size relative to screen size | Excel Discussion (Misc queries) | |||
How to get screen size ? | Excel Programming |