How can I lock the file while editing by VBA?

Highlighted
New Contributor

How can I lock the file while editing by VBA?

Hi all,

 

I us the boxSync file to run the macros but I want to lock the file by macro so other user can not run the macro or update the file at the same moment. Is there any function to automaticaly lock the file when it is opened by user and unclock when closing the file?

 

Thank you!

4 REPLIES 4
Highlighted
Box Employee

Re: How can I lock the file while editing by VBA?

This endpoint lets you lock and unlock a file, but I am not sure how to make this API call using VBA.

Highlighted
New Contributor

Re: How can I lock the file while editing by VBA?

Thank you Murtza! I will take a look on that whether I can use it or not.

Highlighted
Occasional Contributor

Re: How can I lock the file while editing by VBA?

Hello,

 The link "this endpoint" takes to the page which has the list of APIs, can you please let me know which is the exact API that can be used to lock/unlock a file.

 

Thanks,

Highlighted
Contributor

Re: How can I lock the file while editing by VBA?

Hi @badribax, the link is not valid now since the developer website got updated. You need to make a Update call on the file with lock parameter, hope this helps.