Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-96032

Can't preview .xls file on "Office Excel" macro if the Worksheet Name parameter is specified

XMLWordPrintable

      Issue Summary

      If an .xls file is added to the Office Excel macro and the Worksheet Name macro parameter is specified, the macro does not display the expected content and instead displays an error message:

      We can't preview this file. You'll have to download the file to view it.

      This is reproducible on Data Center: (yes) / (no): Yes

      Steps to Reproduce 

      1. Create a page, attach an Excel file (.xls), and then save the page.
      2. Edit the page and insert Office Excel Macro.
      3. While inserting the file, enter the Worksheet Name parameter based on the sheet name of the Excel file, as shown in the screenshot below:
      4. Click the save button and update the page. 

      Expected Results

      The content of the designated sheet should be appropriately displayed on the Confluence page.  

      Actual Results

      Once the page is saved, the macro displays an error message on the Confluence page, as shown below:

      The logs will display the following error message:

      2024-06-26 13:12:55,145 ERROR [http-nio-8090-exec-5 url: /confluence/rest/office/1.0/view; user: admin] [com.benryan.rest.ConverterMacroResource] getContent The supplied data appears to be in the OLE2 Format. You are calling the part of POI that deals with OOXML (Office Open XML) Documents. You need to call a different part of POI to process this data (eg HSSF instead of XSSF)
       -- referer: https://localhost:8090/confluence/display/TEST/new+xls+file+page | url: /confluence/rest/office/1.0/view | traceId: 75fa95e96ee302a8 | userName: admin 

      Workaround 

      Note: The issue can't be reproduced in 7.19.20.

      As a workaround, we can perform either one of the following steps:

      1. Edit the Excel macro on the page to remove the value of the Worksheet Name parameter.
      2. Convert the file extension from .xls to .xlsx and re-upload the file to the page.

              a9293dbdc671 Thomas Rogozinski
              9dd52b4ca361 Brent Lin
              Votes:
              13 Vote for this issue
              Watchers:
              19 Start watching this issue

                Created:
                Updated:
                Resolved: