Standard Workbook Properties : ActiveWorkbook « Excel « VBA / Excel / Access / Word






Standard Workbook Properties

 
Sub TestPrintGeneralWBInfo()
    Dim wb As Workbook
    Set wb = ActiveWorkbook

    Debug.Print "Name: " & wb.name
    Debug.Print "Full Name: " & wb.FullName
    Debug.Print "Code Name: " & wb.CodeName
    Debug.Print "Path: " & wb.Path
    If wb.ReadOnly Then
        Debug.Print "The workbook has been opened as read-only."
    Else
        Debug.Print "The workbook is read-write."
    End If
    If wb.Saved Then
        Debug.Print "The workbook does not need to be saved."
    Else
        Debug.Print "The workbook should be saved."
    End If
End Sub

 








Related examples in the same category

1.Get current active workbook full name
2.Opens a workbook named MyWorkbook.xls located in the same directory as the active workbook. An error is generated if the file cannot be found.
3.Saving Worksheets as Web Pages
4.Previewing a workbook before saving it as a Web page
5.For Each-Next is useful for cycling through each member of a collection
6.Saves the worksheet range "$A$1:$B$11" as a Web page without interactivity so that it can be viewed in any current browser:
7.Looping through a Collection: use the For Each- Next structure
8.Closes the active workbook without saving changes
9.Protects the structure and windows of the active workbook with the password 0llsecurd:
10.Working with the ActiveWorkbook Object
11.Printing a Worksheet
12.Setting Excel to Remove Personal Information from the File Properties When You Save
13.Setting Passwords and Read-Only Recommendation for a Workbook
14.To set a "password to modify," set the WritePassword property of the Workbook object.
15.Opening a New Window on a Workbook
16.Programmatically Retrieving Link Source Information