Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
WA WA is offline
external usenet poster
 
Posts: 37
Default Resize object by HxW using pixels

Is it possible to resize an object in excel to a certain number of pixels??
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default 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
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
How do I resize a check box form object in Excel? bpoole Excel Discussion (Misc queries) 1 May 11th 06 06:38 PM
I could NOT resize the axis title but excel allows me to resize gr Iwan Setiyono Ko Charts and Charting in Excel 0 March 15th 06 10:34 AM
some columns 30 characters 155 pixels others 310 pixels why vurden Excel Discussion (Misc queries) 2 April 26th 05 03:30 AM
resize object dosen't take?? Gary Excel Worksheet Functions 1 March 21st 05 06:39 PM
resize object dosen't take??? gary Excel Discussion (Misc queries) 0 March 20th 05 10:39 PM


All times are GMT +1. The time now is 07:42 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"