Excel 2016 sharepoint file still opens as readonly

excelsharepointvba

Since updating to Office 2016 I can't get excel to open a sharepoint file as editable, despite declaring it to do so.

Workbooks.Open ThisWorkbook.Sheets("Filelist").Cells(i, 2), _
    UpdateLinks:=False, ReadOnly:=False, Local:=True, Editable:=True

The file opens without issues, but I have to run a break on the next line to stop the macro and manually select EDIT, before allowing the code to proceed.

enter image description here

Whilst this is an obvious work around, I am looping through about 40 files, and have to do this manually in each open instance.

Best Answer

Ok so I found a solution to this LockServerFile is the equivalent of hitting the Edit Workbook button.

When opening with VBA you can follow the open command with:

Workbooks.Open ThisWorkbook.Sheets("Filelist").Cells(i, 2)
ActiveWorkbook.LockServerFile

Solved my problem for now if anyone comes across a similar issue.

Related Topic