chuckchuckit
Well-known Member
- Joined
- Sep 18, 2010
- Messages
- 541
Following code finds the resolution of your monitor (the monitor they usually call monitor 1). But if you have a 2nd or 3rd monitor that is set to a different resolution, and Excel running this code is running in monitor 2 or 3, it still returns the resolution of the main monitor #1.
How can I find the resolution of the other monitors. Or at least just find the resolution from the monitor Excel is runnning on, when it is not in the main monitor?
Should I be making the current monitor being used, active somehow?
Thanks.
Chuck
How can I find the resolution of the other monitors. Or at least just find the resolution from the monitor Excel is runnning on, when it is not in the main monitor?
Should I be making the current monitor being used, active somehow?
Code:
Option Explicit
Declare Function GetSystemMetrics32 Lib "User32" _
Alias "GetSystemMetrics" (ByVal nIndex&) As Long
Public Sub Test()
MsgBox GetSystemMetrics32(0) & " x " & GetSystemMetrics32(1)
End Sub
Chuck
Last edited: