HeinzBrunner
New Member
- Joined
- Jul 6, 2018
- Messages
- 1
Hi
I have a macro, which opens another Excel file from Sharepoint and writes data in it. To write-enable the file, I use "ActiveWorkbook.LockServerFile". This works fine with Office 2016.
Now we are changing gradually to Office 365, so some computers are equipped with with Office 2016 and some with Office 365. In Office 365, ActiveWorkbook.LokServerFile gives a run time error 1004.
When I omit this line and instead include in the file I am opening the Macro:
Private Sub Workook_Open()
ActiveWorkbook.LockServerFile
End Sub
it works in Offfice 365, but office 2016 doesn't enable editing and the main macro can't write the data.
I need a solution, which works with both, Office 2016 and 365. Can someone help?
Thanks
Heinz
I have a macro, which opens another Excel file from Sharepoint and writes data in it. To write-enable the file, I use "ActiveWorkbook.LockServerFile". This works fine with Office 2016.
Now we are changing gradually to Office 365, so some computers are equipped with with Office 2016 and some with Office 365. In Office 365, ActiveWorkbook.LokServerFile gives a run time error 1004.
When I omit this line and instead include in the file I am opening the Macro:
Private Sub Workook_Open()
ActiveWorkbook.LockServerFile
End Sub
it works in Offfice 365, but office 2016 doesn't enable editing and the main macro can't write the data.
I need a solution, which works with both, Office 2016 and 365. Can someone help?
Thanks
Heinz