locked
Getting Meta Data without Opening the File.Using Excel VBA RRS feed

  • Question

  • Using VBA from Excel, I want to get the values of several of the built in properties for several  Excel files on disk without opening the files.  The files will be selected with FileDialog similar to this:

    .... code ....

        With Application.FileDialog(msoFileDialogOpen)
             .AllowMultiSelect = True
             .Show
           For c = 1 To .SelectedItems.Count
    .... more code....

           Next c

    .... more code ....

        End With

    What objects, methods, etc do I need to get the meta data without opening the files?

     

    Thanks,

    Dennis

     


    Dennis
    Wednesday, September 21, 2011 9:02 AM

Answers

All replies

  • See:

     

    Returning Property Values From A Closed File

    in:

    http://www.cpearson.com/excel/docprop.aspx

     

     


    gsnu201106
    Wednesday, September 21, 2011 10:32 AM
  • Thanks Gary's Student for replying.

    Sorry I forgot to state that I was using Excel from Office 2010 so the DSOfile.dll apparently won't be the right approach.

    I'll take a look at the file you reference.  Hopefully, I'll be able get what I need with a little study.  I'll let you know.


    Dennis
    Friday, September 23, 2011 12:03 AM
  • Perhaps thru the Shell:

     

    http://technet.microsoft.com/en-us/library/ee176615.aspx

     

     


    gsnu201106
    • Marked as answer by DragonTsaurus Monday, September 26, 2011 3:24 AM
    Friday, September 23, 2011 12:31 AM
  • You can't use the DSOFile.dll with 2010 64bit, but if you're using 32bit Office you should be able to use DSOFile.dll, even on Win 64bit.

    Peter Thornton

    Saturday, September 24, 2011 3:19 PM
  • Thanks Gary's Student,

    The shell was a good idea.  Your link gave me what I needed.  I now have a way of accessing file properties in any directory on my disk and using them in Excel.


    Dennis
    Monday, September 26, 2011 3:24 AM