#If VBA7 Then
Private Declare PtrSafe Function GetDC Lib "user32" (ByVal hwnd As LongPtr) As LongPtr
Private Declare PtrSafe Function ReleaseDC Lib "user32" (ByVal hwnd As LongPtr, ByVal hDC As LongPtr) As Long
Private Declare PtrSafe Function GetDeviceCaps Lib "gdi32" (ByVal hDC As LongPtr, ByVal nIndex As Long) As Long
#Else
Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function ReleaseDC Lib "user32" (ByVal hwnd As Long, ByVal hDC As Long) As Long
Private Declare Function GetDeviceCaps Lib "gdi32" (ByVal hDC As Long, ByVal nIndex As Long) As Long
#End If
Private Const LOGPIXELSX = 88 'Pixels/inch in X
Private Const LOGPIXELSY = 90 'Pixels/inch in Y
'--------------------
'Point to Pixel ratio
'--------------------
Private Function PointToPixel() As Double
Dim DotsPerInch As Double
Dim hDC As Variant
hDC = GetDC(0)
DotsPerInch = GetDeviceCaps(hDC, LOGPIXELSX)
Call ReleaseDC(0, hDC)
PointToPixel = DotsPerInch / Application.InchesToPoints(1)
End Function