'VBA Runtime error 50290 - Running code in .xslm file, checked out from sharepoint online, failed

I have a local source xls file which is updating a .xlsm file, located in sharepoint online. When checking out the file from sharepoint the initial code in Workbook_Open() always fails with runtime error 50290 given me various reasons, depending on what code runs first in .open routine.

I reduced the setup to a new local .xls just containing

Sub CheckOutAndOpenFromSharePoint()
Dim FilePath As String
Dim FileName As String


FilePath = "https://xxxxxx.sharepoint.com/sites/xxxxxxxxxx/Shared%20Documents/"
FileName = "test.xlsm"
If Workbooks.CanCheckOut(FilePath & FileName) = True Then
    Workbooks.CheckOut (FilePath & FileName)
Else
    MsgBox FileName & " can't be checked out at this time.", vbInformation
End If
End Sub

There are no problems with .xls files, with no code in it. Also tried a fresh .xlsm file just containing

Private Sub Workbook_Open()

   Application.ScreenUpdating = False

End Sub

with no improvement

Also switched to a folder which was created by myself and also modified TrustCenter settings in Excel for Protected View and MacroExecution to minimum security with no different result.

Same procedure works works fine from from other workstations.

Reinstalling Excel is not working as it is Office365 managed by the company.

I really have no ideas left where to look.

Any suggestions welcome



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source