+ Reply to Thread
Results 1 to 5 of 5

Macro to copy the image attributes eg. name, size, type, dimensions from folder containing

Hybrid View

busybee235 Macro to copy the image... 10-02-2012, 05:26 AM
AloraRando22 Re: Macro to copy the image... 07-21-2014, 11:34 AM
Leith Ross Re: Macro to copy the image... 07-21-2014, 02:15 PM
AloraRando22 Re: Macro to copy the image... 07-31-2014, 11:13 AM
Leith Ross Re: Macro to copy the image... 07-31-2014, 11:32 AM
  1. #1
    Registered User
    Join Date
    09-28-2012
    Location
    sweden
    MS-Off Ver
    Excel 2007
    Posts
    14

    Macro to copy the image attributes eg. name, size, type, dimensions from folder containing

    copy the image attributes eg. size, type, dimensions to excel cells without copying image itself to excel just fetching its details from a folder that contains a lot of images??

    Thanks

  2. #2
    Registered User
    Join Date
    07-16-2014
    Location
    boston, ma
    MS-Off Ver
    MS 2013
    Posts
    2

    Re: Macro to copy the image attributes eg. name, size, type, dimensions from folder contai

    any luck with this in the last 2 years? I am struggling as well

  3. #3
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Macro to copy the image attributes eg. name, size, type, dimensions from folder contai

    Hello AloraRando22,

    Welcome to the Forum!

    This macro will list all of a file's information. It will prompt you to choose a file and then list all of the file's details that are available in the Window's system for your computer on the ActiveSheet.

    NOTE: Be sure the ActiveSheet is a blank sheet in your workbook before running this macro!

    Sub ListFileInfo()
    
      ' Written: July21, 2014
      ' Author:  Leith Ross
      ' Summary: List all Windows information about a file
      '          on the Active Sheet in Columns A:E starting
      '          at row 1.
    
        Dim FileName    As String
        Dim FolderPath  As Variant   ' This must be a Variant!
        Dim oFile       As Object
        Dim oFolder     As Object
        Dim oShell      As Object
        Dim Path        As Variant
        Dim Rng         As Range
        
            
            Path = Application.GetOpenFilename("All Files (*.*),*.*")
            If Path = "" Then Exit Sub
            
            Path = Split(Path, "\")
            FileName = Path(UBound(Path))
            
            ReDim Preserve Path(UBound(Path) - 1)
            FolderPath = Join(Path, "\")
            
            Set oShell = CreateObject("Shell.Application")
            Set oFolder = oShell.Namespace(FolderPath)
            Set oFile = oFolder.ParseName(FileName)
            
            Set Rng = Range("A1")
            
                For i = 0 To 300
                  ' List the index value and it's description.
                    Rng.Offset(i, 0).Resize(1, 2).Value = Array(i, oFolder.GetDetailsOf(Nothing, i))
                    
                  ' List the file's information for this index value.
                    Rng.Offset(i, 4).Value = oFolder.GetDetailsOf(oFile, i)
                Next i
                
    End Sub
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  4. #4
    Registered User
    Join Date
    07-16-2014
    Location
    boston, ma
    MS-Off Ver
    MS 2013
    Posts
    2

    Re: Macro to copy the image attributes eg. name, size, type, dimensions from folder contai

    Thank you very much! this works perfectly

  5. #5
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Macro to copy the image attributes eg. name, size, type, dimensions from folder contai

    Hello AloraRando22,

    You're welcome.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Resize the image according to the cell dimensions.
    By yeshwant_sur in forum Excel General
    Replies: 1
    Last Post: 02-28-2013, 03:05 AM
  2. [SOLVED] Macro to return JPG image from URL (2 URL's in an IF statement determined by dimensions
    By Rob Broggi in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 02-27-2013, 04:00 PM
  3. Copy & Paste image from a folder to an outlook mail
    By blue J in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-27-2012, 07:15 AM
  4. Picking up Image Attributes from Folder File
    By gcarterm in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 06-18-2012, 02:35 AM
  5. Array Size & Dimensions Best Practice
    By pipsturbo in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-26-2011, 11:34 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1