Excel 2010 - How to automatically set default Document Title equal to Filename?

Steve116

New Member
Joined
Sep 21, 2016
Messages
1
Our company will soon utilize a commercialized Google search engine application to search through corporate folders in search of files. Apparently the search engine relies upon Document Property Titles, not the Document Filenames to provide the most efficient search. We've got a huge project underway to make sure each of the tens of thousands of files have a Document Title.
The problem is that we create many new files every single day and would like to avoid having to both Name the File and remember to give it a Document Title. Is there a way we can automatically set the (default) Document Title equal to the Filename at the point in time the file is saved?
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Hi Steve,

You could use something like this, but you either have to put it in the Personal.xlsb on everybody's computer or perhaps find another way to implement it. At any rate this will do what you want as long as on new workbook you save it first and then close it.

You may want to play with what triggers the code, but this is the essence of what you want....

If you want to google "BuiltinDocumentProperties" perhaps you will be able to create something more suitable for your company.

Code:
Private Sub Workbook_AfterSave(ByVal Success As Boolean)
    Dim DocProp1 As String
    DocProp1 = Me.Name
    ThisWorkbook.BuiltinDocumentProperties("Title") = DocProp1
End Sub

HTH

igold
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

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