Forum Discussion

vtcs2424's avatar
vtcs2424
Copper Contributor
Dec 07, 2024

Saving... / Saved text in title bar

How to retrieve value from title bar if it has saving... Or saved using VBA in excel.

 

I think that it is used to show if file is synced to SharePoint online or not....

 

PLEASE REMOVE THIS IMAGE IT IS DUPLICATE

 

  • Referring this:

     

    1. Access the Title Bar Text:
      • You can use the Application.Caption property to get the text from the title bar.
    2. Check for Specific Text:
      • Use VBA to check if the title bar contains "Saving..." or "Saved".

    Here's a sample VBA code to achieve this:

    Sub CheckTitleBarStatus()
        Dim titleBarText As String
        titleBarText = Application.Caption
        
        If InStr(titleBarText, "Saving...") > 0 Then
            MsgBox "The file is currently saving."
        ElseIf InStr(titleBarText, "Saved") > 0 Then
            MsgBox "The file is saved and synced."
        Else
            MsgBox "The file is not in a saving state."
        End If
    End Sub

    Steps to Implement the Code:

    1. Press Alt + F11 to open the VBA editor.
    2. Insert a new module by clicking Insert > Module.
    3. Copy and paste the above code into the module.
    4. Run the CheckTitleBarStatus macro to check the title bar status.

Resources