How to lock an Excel file with javascript Excel API

%3CLINGO-SUB%20id%3D%22lingo-sub-330081%22%20slang%3D%22en-US%22%3EHow%20to%20lock%20an%20Excel%20file%20with%20javascript%20Excel%20API%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-330081%22%20slang%3D%22en-US%22%3E%3CP%3EHow%20can%20I%20lock%20an%20Excel%20file%20with%20JavaScript%20Excel%20API%3F%20Is%20it%20possible%3F%20(read-only).%3C%2FP%3E%3CP%3EI%20use%20Excel%202013.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThank%20you%2C%26nbsp%3B%3C%2FP%3E%3CP%3ECrissy%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-330081%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EJavaScript%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Occasional Visitor

How can I lock an Excel file with JavaScript Excel API? Is it possible? (read-only).

I use Excel 2013. 

 

Thank you, 

Crissy

1 Reply
This is not possible in Excel 2013.

Excel API 1.8 includes a property for checking if a workbook is open in read-only mode.
Only available to Office 365 subscription users.
https://docs.microsoft.com/en-us/javascript/api/excel/excel.workbook?view=excel-js-preview#readOnly

Excel API 1.1 includes a method for saving a workbook as read-only.
Excel 2016 and Excel Online

https://bettersolutions.com/javascript/excel-api/releases.htm