I have a test workbook that I was trying some new code.

The problem seems to occur when I try to save a SHARED workbook for EXCLUSIVE USE.

The following code is used in the Workbook_BeforeClose event:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
On Error GoTo ErrorHandler

    Select Case MsgBox("Do you want to save your work?", vbYesNoCancel)
    
        Case vbCancel
            
            Cancel = True
            
            Exit Sub
            
        Case vbNo
            
            ThisWorkbook.Saved = True
            
            Exit Sub
            
        Case vbYes
        
            Select Case MsgBox("Do you want to save as a SHARED workbook?", vbYesNo)
                
                Case vbNo
                
                    If ThisWorkbook.MultiUserEditing = True Then
                        ThisWorkbook.ExclusiveAccess    '<<<<<< THIS IS GIVING AN ERROR
                    Else
                        ThisWorkbook.SaveAs Filename:=ThisWorkbook.Name, FileFormat:=xlOpenXMLWorkbookMacroEnabled, AccessMode:=xlExclusive
                    End If
                
                Case vbYes
                
                    ThisWorkbook.ProtectSharing Filename:=ThisWorkbook.Name, FileFormat:=xlOpenXMLWorkbookMacroEnabled
                
            End Select
    
    End Select

    Exit Sub

ErrorHandler:

    MsgBox Error & vbCrLf & Err.Number

End Sub
As a 'test' workbook, there is no other code present.

This is being performed on a stand alone computer, no other users (testing at home for project at work).

Using Excel 2007, Windows Vista Ultimate