title: How to check if Excel file is password protected?
body: <p>I am looking for help, how to check if my excel (<code>.xl*</code>) file is protected by password or not(I do not mean sheet_protection but whole file (work_book).</p>
  
  <p>I was thinking about using vba by xlwings.api to do that, but can't figure out how to do that.
  I found vba code for that here:
  <a href="https://www.thespreadsheetguru.com/the-code-vault/2014/12/17/determine-if-workbook-or-worksheet-is-password-protected-with-excel-vba?rq=password" rel="nofollow noreferrer">https://www.thespreadsheetguru.com/the-code-vault/2014/12/17/determine-if-workbook-or-worksheet-is-password-protected-with-excel-vba?rq=password</a></p>
  
  <p>Any ideas?</p>