admin管理员组

文章数量:1123687

I have been having issues with co-authoring where a yellow alert banner pops up indicating that autosave has been switched off and is unable to be switched back on. Not everyone in the group notices this when it happens causing some changes to be lost.

I am aiming to have the workbook check if autosave is on every time there is a change in the sheet. The aim is also to switch it back on when possible or to proceed to the error handler and prompt the user to close and re-open the sheet when it is not able to do so.

However, I cannot seem to get it to work, the msgbox does not display when this happens. Below is the subroutine.

Public Sub CheckAutoSave() 'add to Thisworkbook sheetchange

    With ActiveWorkbook
        If .AutoSaveOn = False Then
            .AutoSaveOn = True
            On Error GoTo AutoSaveErrHandler
            GoTo SkipErrHandler
            
AutoSaveErrHandler:
MsgBox "AutoSave failed to turn on, Re-open file.", vbOKOnly

    
SkipErrHandler:
        End If

    End With
End Sub

本文标签: excelHow do I check If autosave is on and then switch it back on if it is notStack Overflow