VBA finding image dimensions

Associate
Joined
26 Feb 2004
Posts
971
Location
China (Qinhuangdao)
I'm trying to get the dimensions of all image files in one of my folders. In the past I made a VBA script in Excel to do this, using 'GetDetailsOf'. But it doesn't seem to work now, using Excel 2007 under Windows 7 64bit.

Is there another way of finding the image dimensions?
 
IIRC, you can use MS Shell Control and Automation object (Tools -> Reference) and use 'ExtendedProperty' to grab the dimensions.

Edit - Copied from E-E:
Code:
Dim objShell As New Shell
Dim objFolder As Folder
Dim objFile As ShellFolderItem

Set objFolder = objShell.NameSpace(<path to file>)
Set objFile = objFolder.ParseName(<file name>)

MsgBox objFile.ExtendedProperty("Dimensions")
 
Last edited:
Back
Top Bottom