'Ignore UserForm external margins for a precise visual position
If IgnoreUserFormExternalMargins Then
LeftMarginShift = (UserForm.Width - UserForm.InsideWidth) ' / 2
#If Mac Then
TopMarginShift = LeftMarginShift
#Else
'Calculate UserForm Caption Height
'UserFormHeight = UserForm.Height
'UserForm.Height = 0
'CaptionHeight = UserForm.Height
'UserForm.Height = UserFormHeight
'TopMarginShift = (UserForm.Height - CaptionHeight - UserForm.InsideHeight) '/ 2
'Windows étrangement ne positionne pas sur la marge !?
TopMarginShift = 0
#End If
End If
Set Pan = ObjectPane(WorksheetObject, Visible:=False)
#If Mac Then
UserForm.Left = Pan.PointsToScreenPixelsX(WorksheetObject.Left) - LeftMarginShift + HorizontalShiftPoints
UserForm.Top = Pan.PointsToScreenPixelsY(WorksheetObject.Top) - TopMarginShift + VerticalShiftPoints
#Else
UserForm.Left = PixelsToPointsX(Pan.PointsToScreenPixelsX(WorksheetObject.Left)) + LeftMarginShift + HorizontalShiftPoints
UserForm.Top = PixelsToPointsY(Pan.PointsToScreenPixelsY(WorksheetObject.Top)) - TopMarginShift + VerticalShiftPoints
#End If