#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default ColumnWidth

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
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
|


Reply
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
Columnwidth Jean-Paul Excel Discussion (Misc queries) 1 November 24th 09 02:21 PM
ColumnWidth Dwight[_4_] Excel Programming 2 July 14th 04 08:22 PM
Columnwidth changes-Event Tom Excel Programming 3 February 16th 04 03:36 PM
Selection.ColumnWidth Ron McCormick[_2_] Excel Programming 2 December 29th 03 11:41 AM
ColumnWidth not working... BEE Excel Programming 2 December 19th 03 06:29 PM


All times are GMT +1. The time now is 05:00 AM.

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

About Us

"It's about Microsoft Excel"