Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-15-2012, 10:12 PM
tinfanide tinfanide is offline Excel VBA: PixelsToPoints??? Windows 7 64bit Excel VBA: PixelsToPoints??? Office 2010 32bit
Expert
Excel VBA: PixelsToPoints???
 
Join Date: Aug 2011
Posts: 312
tinfanide is on a distinguished road
Default Excel VBA: PixelsToPoints???


As mentioned, any VBA method to convert pixels to points?
I've tried:
Code:
''' 72 pixels should be approximately 8.38 (?unit)
ActiveWindow.PixelsToPoints(72)
''' return 0
Reply With Quote
  #2  
Old 04-16-2012, 05:17 AM
macropod's Avatar
macropod macropod is offline Excel VBA: PixelsToPoints??? Windows 7 64bit Excel VBA: PixelsToPoints??? Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

From Word's vba Help file:
Code:
MsgBox "320x240 pixels is equivalent to " _
    & PixelsToPoints(320, False) & "x" _
    & PixelsToPoints(240, True) _
    & " points on this display."
Also from Word's vba Help file:
Code:
MsgBox "180x120 points is equivalent to " _
    & PointsToPixels(180, False) & "x" _
    & PointsToPixels(120, True) _
    & " pixels on this display."
Excel doesn't have the same methods, so you can't do this from Excel unless you use the Windows API or an application whose object model does support them.

PS: Please don't post Excel vba queries in the Word vba forum - post them in the Excel forum.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 04-18-2012, 07:14 AM
tinfanide tinfanide is offline Excel VBA: PixelsToPoints??? Windows 7 64bit Excel VBA: PixelsToPoints??? Office 2010 32bit
Expert
Excel VBA: PixelsToPoints???
 
Join Date: Aug 2011
Posts: 312
tinfanide is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
From Word's vba Help file:
Code:
MsgBox "320x240 pixels is equivalent to " _
    & PixelsToPoints(320, False) & "x" _
    & PixelsToPoints(240, True) _
    & " points on this display."
Also from Word's vba Help file:
Code:
MsgBox "180x120 points is equivalent to " _
    & PointsToPixels(180, False) & "x" _
    & PointsToPixels(120, True) _
    & " pixels on this display."
Excel doesn't have the same methods, so you can't do this from Excel unless you use the Windows API or an application whose object model does support them.

PS: Please don't post Excel vba queries in the Word vba forum - post them in the Excel forum.
Did I happen to post this thread in the Word vba forum?
Reply With Quote
  #4  
Old 04-19-2012, 04:40 AM
macropod's Avatar
macropod macropod is offline Excel VBA: PixelsToPoints??? Windows 7 64bit Excel VBA: PixelsToPoints??? Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
Originally Posted by tinfanide View Post
Did I happen to post this thread in the Word vba forum?
Yes. I moved it here ...
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 04-19-2012, 07:58 AM
tinfanide tinfanide is offline Excel VBA: PixelsToPoints??? Windows 7 64bit Excel VBA: PixelsToPoints??? Office 2010 32bit
Expert
Excel VBA: PixelsToPoints???
 
Join Date: Aug 2011
Posts: 312
tinfanide is on a distinguished road
Unhappy

Quote:
Originally Posted by macropod View Post
Yes. I moved it here ...
Oh... it seemed to have been done by me a few times.
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2007 custom ribbon not showing in Excel 2010 Paulzak Excel 2 02-17-2012 06:35 PM
Excel VBA: PixelsToPoints??? saving data in excel 2010 from excel 2003 johnkcalg Excel 1 02-06-2012 07:33 PM
Excel VBA: PixelsToPoints??? VBA code from Excel 2007 in Excel 2010 csam63 Excel Programming 1 10-07-2011 10:46 AM
Excel VBA: PixelsToPoints??? Excel Hyperlinks crash Excel programme martinlest Excel 8 01-26-2011 04:23 AM
Excel VBA: PixelsToPoints??? Opening multiple Excel files within the same Excel window. lost9471 Excel 2 05-01-2010 01:57 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:41 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft