Bonsoir,
Depuis que je suis passé sur office 2021, j'ai une erreur sur cette ligne (Erreur d'exécution '1004') :
poinTtoPixel = (.PointsToScreenPixelsY(Cells.Height) - ActiveWindow.ActivePane.PointsToScreenPixelsY(0)) / Cells.Height
Voici le code intégral, qui permet d'ouvrir un usf dans un emplacement précis. (Cellule)
Sub USFPositionMotif(Target, USF)
Dim X&, Y&, poinTtoPixel#
With ActiveWindow.ActivePane
poinTtoPixel = (.PointsToScreenPixelsY(Cells.Height) - ActiveWindow.ActivePane.PointsToScreenPixelsY(0)) / Cells.Height
X = .PointsToScreenPixelsX((Target.Offset(0, 1).Left) - 150) / poinTtoPixel
Y = .PointsToScreenPixelsY(Target.Top) / poinTtoPixel - 118
End With
With USF
.StartUpPosition = 0
.Show 0
.Top = Y: .Left = X
End With
End Sub
Que pensez-vous ?