title: ABAP OLE - Open excel password protected workbook
body: <p>I'm trying to open a password protected excel file using SAP ABAP OLE OBJECT as follows:</p>
  
  <pre><code>DATA: lt_excel_line(4096) OCCURS 10 WITH HEADER LINE.
  DATA: app       TYPE ole2_object,
        workbook  TYPE ole2_object,
        worksheet TYPE ole2_object.
  
  CREATE OBJECT app 'EXCEL.APPLICATION'.
  SET PROPERTY OF app 'VISIBLE' = 0.
  
  CALL METHOD OF app 'WORKBOOKS' = workbook.
  
  CALL METHOD OF workbook 'OPEN'
    EXPORTING
    #1 = '&lt;filename&gt;'
    #5 = '&lt;password&gt;'.           
  </code></pre>
  
  <p>The filename and password are definitely correct and the following VBA code opens the file as required no problem:</p>
  
  <pre><code>Dim wb1 As Workbook
  Set wb1 = Workbooks.Open Filename:="&lt;filename&gt;", Password:="&lt;password&gt;")
  </code></pre>
  
  <p>But the ABAP code always returns sy-subrc = 2. Anyone know what could be going on? Or what else I can try? Grateful for any help.</p>