Prev: Range created using Union...accessing cells
Next: Assign a range to where the User Form places data
From: Gary Brown on 23 Dec 2009 13:35 This macro (GetWorkbookProperties) will give you a message box with the Workbook properties. -- Hope this helps. If it does, please click the Yes button. Thanks in advance for your feedback. Gary Brown '/=======================================/ ' Sub Purpose: List Workbook Properties to Msgbox ' both Built-in and Custom ' 01/24/2000 '/=======================================/ ' Sub GetWorkbookProperties() Dim objProperty As Object Dim strAnswer As String On Error Resume Next 'List Workbook name and size strAnswer = "Workbook: " & _ " " & Excel.ActiveWorkbook.name & vbCr & _ Excel.ActiveWorkbook.FullName & vbCr & _ " - Workbook File Size: " & _ Format(FileLen(Excel.ActiveWorkbook.FullName) / 1024, _ "#,##0") & " kb" & vbCr 'List Builtin Document Properties For Each objProperty In _ ActiveWorkbook.BuiltinDocumentProperties With objProperty strAnswer = strAnswer & vbCr & _ "Builtin - " & .name & " : " & .value End With Next 'List Custom Document Properties For Each objProperty In _ ActiveWorkbook.CustomDocumentProperties With objProperty strAnswer = strAnswer & vbCr & _ "Custom - " & .name & " : " & .value End With Next MsgBox strAnswer exit_Sub: On Error Resume Next Exit Sub err_Sub: Debug.Print "Error: " & Err.Number & " - (" & _ Err.Description & _ ") - " & Now() GoTo exit_Sub End Sub '/=======================================/
First
|
Prev
|
Pages: 1 2 Prev: Range created using Union...accessing cells Next: Assign a range to where the User Form places data |