Unlocking a document from server

Add-in Express™ Support Service
That's what is more important than anything else

Unlocking a document from server
 
Martin Bertram




Posts: 2
Joined: 2017-10-30
Is it possible in code to "unlock" a document on the server? Example, an excel document has been opened from SharePoint and the user has gone into edit mode. Now it is locked on the server side and I cannot update its metadata via SharePoint API. Is there a way to unlock it before I perform the API call to update metadata?
Posted 30 Oct, 2017 07:11:17 Top
Andrei Smolin


Add-in Express team


Posts: 18821
Joined: 2006-05-11
Hello Martin,

This requires that you close the document.


Andrei Smolin
Add-in Express Team Leader
Posted 30 Oct, 2017 07:18:16 Top
Martin Bertram




Posts: 2
Joined: 2017-10-30
Hi Andrei,

Is there any event I can use to perform an action after the document is closed? All I've found is Before Close event.

Thanks
Posted 30 Oct, 2017 07:23:34 Top
Andrei Smolin


Add-in Express team


Posts: 18821
Joined: 2006-05-11
I would look into using the Commandbars.OnUpdate event (see https://msdn.microsoft.com/en-us/vba/office-shared-vba/articles/commandbars-onupdate-event-office) to check if the workbook in question is closed or not. In Add-in Express, this event is mapped to the CommandbarsUpdate event of the ADXExcelAppEvents component; you need to put it onto the add-in module.

At https://www.add-in-express.com/creating-addins-blog/2012/02/21/excel-shapes-events/ we demonstrate using this event to create shape selection events missing in Excel.


Andrei Smolin
Add-in Express Team Leader
Posted 30 Oct, 2017 07:40:13 Top