When you are putting together a workbook, Excel tracks quite a bit of information that it collectively refers to as workbook properties. You can view the different properties maintained by displaying the Properties dialog box.
In Word you have the option to print document properties, if you desire. There is no intrinsic way to print workbook properties in Excel. Instead, you must resort to a macro that will place the names and values of the properties into a worksheet. You can then print the worksheet and have your workbook properties available in hardcopy format.
The following macro is an example of a good way to copy all the workbook properties to a worksheet that can be printed:
Public Sub WorksheetProperties() Dim p As DocumentProperty Dim iRow As Integer 'Built in Properties iRow = 1 Cells(iRow, 1).Value = "Built-in Properties" Cells(iRow, 1).Font.Bold = True iRow = iRow + 1 Worksheets(1).Activate For Each p In ActiveWorkbook.BuiltinDocumentProperties On Error Resume Next Cells(iRow, 2).Value = p.Name 'If no value then Excel causes an error so ignore! Cells(iRow, 3).Value = p.Value iRow = iRow + 1 Next On Error GoTo 0 'Custom Properties iRow = iRow + 1 Cells(iRow, 1).Value = "Custom Properties" Cells(iRow, 1).Font.Bold = True iRow = iRow + 1 For Each p In ActiveWorkbook.CustomDocumentProperties On Error Resume Next Cells(iRow, 2).Value = p.Name Cells(iRow, 3).Value = p.Value iRow = iRow + 1 Next On Error GoTo 0 End Sub
Note:
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (9149) applies to Microsoft Excel 2007, 2010, and 2013. You can find a version of this tip for the older menu interface of Excel here: Printing Workbook Properties.
Comprehensive VBA Guide Visual Basic for Applications (VBA) is the language used for writing macros in all Office programs. This complete guide shows both professionals and novices how to master VBA in order to customize the entire Office suite for their needs. Check out Mastering VBA for Office 2010 today!
When you are working with workbooks to which multiple people have access, it can be helpful to know who has a particular ...
Discover MoreExcel has the capability to automatically open workbooks when you first start the program. You may not want to have one ...
Discover MoreWorkbooks can get rather large rather quickly. If you think your workbook has gotten too big too fast, here are some ...
Discover MoreFREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
2021-12-22 10:42:08
J. Woolley
My Excel Toolbox includes the dynamic array function ListDocProperties, which lists both built-in and custom (if any) document properties as an array with 2 columns and N rows. You can use it in a cell formula like this:
=ListDocProperties()
In older versions of Excel you can use it with the SpillArray function like this:
=SpillArray(ListDocProperties())
The list applies to the formula cell's workbook.
My Excel Toolbox also includes dynamic array functions ListAppProperties, ListWBProperties, ListWNProperties, and ListWSProperties, which list VBA object model properties for the Application, Workbook, Window, and Worksheet objects.
See https://sites.google.com/view/MyExcelToolbox/
2021-12-21 13:32:05
Vince
Would love to see a sample printout...
2020-07-04 17:51:29
John Mann
I just printed out this tip to add to my library of printed tips. I'll combine this with parts of another tip I have printed (T011929) which includes making a new sheet. That will get over Alan's complaint in the previous tip. I'll test the result on a workbook which I can afford to mess up.
This will be some nice practice for use with Allen's Macros Masterclass course which I'm currently studying.
2018-06-20 18:53:12
Alan Cannon
This is a terrible macro! Since it doesn't ask for a filename it is acting upon the current workbook, and it overwrites whatever is on Sheet1 with the macro output!!! At a minimum it should add a worksheet to the current workbook and output to that sheet.
Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2022 Sharon Parq Associates, Inc.
Comments