Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Resize object by HxW using pixels
Is it possible to resize an object in excel to a certain number of pixels??
|
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Resize object by HxW using pixels
I've never done this, but there are a couple of hints in VBA's help. You may
want to read about PointsToScreenPixelsX and PointsToScreenPixelsY (or maybe search google groups for hints and tips using those keywords). Michel Pierron (a very smart API type guy) posted this: Option Explicit Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" _ (ByVal lpClassName As String, ByVal lpWindowName As String) As Long Private Declare Function GetWindowRect Lib "user32" _ (ByVal hwnd As Long, lpRect As RECT) As Long Private Type RECT Left As Long Top As Long Right As Long Bottom As Long End Type Sub Ratio() Dim hwnd&, R As RECT, msg As String hwnd = FindWindow(vbNullString, Application.Caption) GetWindowRect hwnd, R MsgBox "Points/Pixels Ratio: " _ & Application.Width / (R.Right - R.Left) _ & vbTab & "- (3/4)" & vbLf & "Pixels" _ & "/Points Ratio: " & Format((R.Right - R.Left) _ / Application.Width, "0.00") & vbTab & "- (4/3)", 64 End Sub Maybe you can get the ratio of points to pixels and use that in your calculations. WA wrote: Is it possible to resize an object in excel to a certain number of pixels?? -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I resize a check box form object in Excel? | Excel Discussion (Misc queries) | |||
I could NOT resize the axis title but excel allows me to resize gr | Charts and Charting in Excel | |||
some columns 30 characters 155 pixels others 310 pixels why | Excel Discussion (Misc queries) | |||
resize object dosen't take?? | Excel Worksheet Functions | |||
resize object dosen't take??? | Excel Discussion (Misc queries) |