Forum Discussion
vtcs2424
Dec 07, 2024Copper Contributor
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
3 Replies
Sort By
- vtcs2424Copper Contributor
Actually once it is been saved / synced in SharePoint online, I need to close the workbook? So isn't there direct reference if it has been synced or not? As relying on caption may close the file unintentionally.
Currently once I do .save and then do .close it has popup of perofrming cleanup. And if I do .save and then manually close I see that it only closes the file if text is saved
Is it good approach to rely on caption text?
Referring this:
- Access the Title Bar Text:
- You can use the Application.Caption property to get the text from the title bar.
- 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:
- Press Alt + F11 to open the VBA editor.
- Insert a new module by clicking Insert > Module.
- Copy and paste the above code into the module.
- Run the CheckTitleBarStatus macro to check the title bar status.
- vtcs2424Copper Contributor
Also, application.caption not showing saving... Or saved text, it only shows file name and excel
- Access the Title Bar Text: