ScreenResolution_wxhxtxl

Detects active desktop screen resolution and location of taskbar (with some calculation) using Excel application window
Helpful when you have windows taskbar not at the bottom as default
By comparing Top and Left with other numbers, we can find where is the taskbar located
Gets screen resolution in the format of WidthxHeightxTopxLeft
Example: ScreenResolution_wxhxtxl() = 1341.75x766.5x103x-6

CodeFunctionName
What is this?

Public

Tested

Original Work
Function ScreenResolution_wxhxtxl()
' Gets screen resolution in the format of
' WidthxHeightxTopxLeft
' Example: ScreenResolution_wxhxtxl() = 1341.75x766.5x103x-6
PrevScrUp = Application.ScreenUpdating
PrevState = Application.WindowState
If PrevState < > xlMaximized Then
Application.ScreenUpdating = False
Application.WindowState = xlMaximized
End If
X1 = Application.Width
X2 = Application.Height
T1 = Application.Top
L1 = Application.Left
ScreenResolution_wxhxtxl = X1 & "x" & X2 & "x" & T1 & "x" & L1
Application.WindowState = PrevState
Application.ScreenUpdating = PrevScrUp
End Function

Views 3,385

Downloads 1,452

CodeID
DB ID