View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Lazzaroni Lazzaroni is offline
external usenet poster
 
Posts: 55
Default PointsToScreenPixels Documentation Incorrect

Thank you for the suggestion.

When I try your example verbatim, I get "0 x 0" before and after the zoom.

"Gary''s Student" wrote:

Consider this small test:

Sub Macro1()

Range("I6").Select
Columns("I:I").ColumnWidth = 10
Rows("6:6").RowHeight = 20


ActiveWindow.Zoom = 100
With ActiveWindow
lWinWidth = .PointsToScreenPixelsX(.Selection.Width)
lWinHeight = .PointsToScreenPixelsY(.Selection.Height)
End With
MsgBox (lWinWidth & " x " & lWinHeight)

ActiveWindow.Zoom = 50
With ActiveWindow
lWinWidth = .PointsToScreenPixelsX(.Selection.Width)
lWinHeight = .PointsToScreenPixelsY(.Selection.Height)
End With
MsgBox (lWinWidth & " x " & lWinHeight)

End Sub


The first msgbox gives:
84 x 151

the second ( with a much smaller cell) gives:
79x145

--
Gary''s Student - gsnu200713