Retreiving File Title from a folder

smiths87

Board Regular
Joined
Aug 7, 2006
Messages
106
Hi Everybody,
I'm wondering if anybody knows a way to pull the File Title with a macro that already pulls File Name, Size & Date Modified. I can't seem to figure out how to do it, and I don't see it listed in the VBA File-Related Commands in my ref book. Thanks for any help.
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
What type of file is it? If it's an MS Office document you could use the DSOFile ActiveX component like this:

Code:
Sub DSOFile_Title()

    'Requires reference to DSO OLE Document Properties Reader 2.1
    'Download this from http://support.microsoft.com/kb/224351, install and select/browse for it in Tools - References in VB Editor

    Dim DSO As DSOFile.OleDocumentProperties
    Dim filename As String
    
    Set DSO = New DSOFile.OleDocumentProperties
    
    filename = "F:\temp\excel\test.xls"
    
    DSO.Open filename, True  'True = read only
    Debug.Print DSO.SummaryProperties.Title
    DSO.Close
    
End Sub
 
Upvote 0
So now I have the DSO file and referenced it in the VB Project, but I keep getting "File Not Found" errors for files I know to exist. I think I'm missing something obvious, but I can't figure it out. Anyone else run across this?
 
Upvote 0
Never mind. Just got this working. (didn't realize I had typed in the wrong file extension, hence file really wasn't found.)
 
Upvote 0

Forum statistics

Threads
1,214,624
Messages
6,120,591
Members
448,973
Latest member
ksonnia

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top