I have a folder with 1000s of images and I need to reject the ones which are below a particular dimension (eg. 200x300). If a macro can pull out these details on an Excel sheet, I can use that to straightaway filter out the ones which are not in compliance with the requirement. TIA.
Macro to pull out image dimensions from files in a folder
- Hyperventilate
- Thread is marked as Resolved.
-
-
http://www.snb-vba.eu/alfabet_en.html
look under the "p" for pixels
-
http://www.snb-vba.eu/alfabet_en.html
look under the "p" for pixels
Thanks much for the link; looks like a treasure house of code. I'm just starting out with Macros, the code in the links don't seem to work for me. Even after inserting them under a module, when I try to run them I get a message saying there are no macros to run. I presume I need to do something else apart from just copy pasting them?
-
We should not be advertising other sites but I hope it is allowed in this case.
-
How have you pasted the code. Attach an example of your workbook.
-
-
How have you pasted the code. Attach an example of your workbook.
I did the (alt-F11) and insert module step. Please see attached.
-
You haven't created a Sub, for code to run it needs to be a Sub or Function. You would also need to enter the name of your image
CodeSub GetImageDimensions() With CreateObject("shell.application").Namespace("E:\OF\") c_00 = .getdetailsof(.Items.Item("example.jpg"), 27) End With With CreateObject("shell.application").Namespace("E:\OF\") c_00 = .getdetailsof(.Items.Item("example.jpg"), 28) End With End Sub
The better option is to download the example workbook from Jolivane's link. Then post back for help using it.
-
-
You haven't created a Sub, for code to run it needs to be a Sub or Function. You would also need to enter the name of your image
CodeSub GetImageDimensions() With CreateObject("shell.application").Namespace("E:\OF\") c_00 = .getdetailsof(.Items.Item("example.jpg"), 27) End With With CreateObject("shell.application").Namespace("E:\OF\") c_00 = .getdetailsof(.Items.Item("example.jpg"), 28) End With End Sub
The better option is to download the example workbook from Jolivane's link. Then post back for help using it.
Thank you for the guidance Roy.
-
I don't know how to thank you for this! Works perfectly! Thank you so much, really appreciate it!
-
Participate now!
Don’t have an account yet? Register yourself now and be a part of our community!