LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 55
Default PointsToScreenPixels Documentation Incorrect

I ran this little piece of code to test the PointsToScreenPixelsX and
PointsToScreenPixelsY methods. It's better to run the code using a command
button placed on a spreadsheet, otherwise the active window may change to a
window other than the one with the selected cells in, which causes the
methods to return 0.

Dim oCell As Range
For Each oCell In Selection
oCell.Value = "W = " & ActiveWindow.PointsToScreenPixelsX(oCell.Width) & _
", H = " & ActiveWindow.PointsToScreenPixelsY(oCell.Height)
Next

According to the VBA documentation the methods "convert a vertical
measurement from points (document coordinates) to screen pixels (screen
coordinates). Returns the converted measurement as a Long value."

That doesn't appear to be the case. I can see what the pixel size of any
column or row is by adjusting the width using the column and row markings on
the header. Whatever numbers PointsToScreenPixels is returning, they are not
pixels.

In fact, there is an inverse relationship between the number returned and
the actual width or height of the column or row. In other words, if the width
or height is larger, the value returned by PointsToScreenPixels is smaller.

If anyone can help me sort out this mystery and retrieve the REAL width and
height of any given column or row I would greatly appreciate it.

Thanks.
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Documentation paul johnson Excel Programming 1 January 25th 06 02:32 PM
Documentation paul johnson Excel Programming 3 January 25th 06 09:31 AM
PointsToScreenPixels for Excel97 MRay Excel Programming 4 March 18th 05 04:39 AM
VBA Documentation TJ Walls Excel Programming 5 May 11th 04 01:51 PM
Documentation Mark[_36_] Excel Programming 4 February 5th 04 11:02 AM


All times are GMT +1. The time now is 09:04 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"