I'm having trouble with the save routine closing out when controlling files from with macro's in it, the save task actually completes fully but the "Uploading to SharePoint" dialog keeps running endlessly.
If I click cancel on the dialog the code proceeds to completion and the file is actually saved including changes.
I have mapped a drive which provides access to a SharePoint Folder e.g.
R:\The Folder
I have a workbook in this folder which writes data to several files, to do this it pretty much follows the procedure below. This routine is in separate workbook and there is quite a lot of code preparing data before it gets to this part but the file is only ever opened and closed at the very end.
Sub OpenDoStuffSaveandClose
Workbooks.Open("R:\FiletoAmend.xlsx") 'mapped drive to a SharePoint folder
ActiveWorkbook.LockServerFile 'to prevent other users updating when I'm working on the file
Range("A10:B20").value = "Help!!" 'code that does stuff to the file
ActiveWorkbook.close True 'The the problem occurs here!
end sub
I've tried doing away with LockServerFile, using ActiveWorkBook.SaveAs, ActiveWorkbook.Save, same issue everytime
If I manually open and close 1-2% failure rate
If running the code its a 90% failure rate with one controlled workbook, 10% with the others
I fear there is some sync issue between SharePoint and OneDrive or conflict when running Macro's and controlling these files on SharePoint
To get over this I used ActiveWorkbook.AutoSaveOn = False
but recently this threw errors and was no longer recognised.....out of the blue!
Has anyone experienced this? Has Anyone got any work arounds?
Thanks Jon