When using the Documents.Open("XX") command in excel. My excel prompts the window where it says that the document is lock for editing, by ME. Which isn't the case.
This command does seem to work when i'm using microsoft word/excel 2010 at work. But at home, using office 2016, it doesn't. This goes for my personal laptop with office 2016 aswell.
The following code is used:
Sub test()
Dim wordDoc As Word.Application
Dim testDoc As Word.Application
Set wordDoc = CreateObject("Word.Application")
Set testDoc = wordDoc.Documents.Open("C:\Users\Me\Desktop\Test.docm")
' Do stuff
End Sub
My thoughts:
Office 2016 seems to open a 'Shadow file' which gives the document 'Open' status. But when restarting my PC the code simply does NOT work. Giving an 'Filename' error, upon restarting the code the 'Locked for editing' error appears.
My question:
Am i using the wrong approach on opening a document in Office 2016? If so, what is the right approach? If not, are there settings that need to be changed in order for this to work?
Thanks in advance,