Thread: ColumnWidth
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Rech Jim Rech is offline
external usenet poster
 
Posts: 2,718
Default ColumnWidth

Declare Function GetDC Lib "user32" (ByVal hWnd As Long) As Long
Declare Function GetDeviceCaps Lib "gdi32" (ByVal hDC As Long, ByVal nIndex
As Long) As Long
Declare Function ReleaseDC Lib "user32" (ByVal hWnd As Long, ByVal hDC As
Long) As Long
Const LOGPIXELSX = 88
Const POINTS_PER_INCH As Long = 72

Function PointsPerPixel() As Double
Dim hDC As Long
Dim lDotsPerInch As Long
hDC = GetDC(0)
lDotsPerInch = GetDeviceCaps(hDC, LOGPIXELSX) ''Get the user's DPI
setting
PointsPerPixel = POINTS_PER_INCH / lDotsPerInch
ReleaseDC 0, hDC
End Function


--
Jim
"abhimanyu" wrote in message
oups.com...
| Hi
|
| I need to set Excel;s cell ColumnWidth in pixels instead of Points. I
| have a picture that I need to put over the cell, for this I need to
| resize cell accordingly.
|
| thanks
|