Free Support Forum - aspose.com

Error opening workbook

Hello,

I have a problem of opening one workbook.

Here is a simple test and file for you to check this. I’m using aspose version com.aspose.cells-2.5.0-jdk5. I tested with some other versions result is the same.
=================================================================================
import org.junit.Test;

import com.aspose.cells.Workbook;
public class XlsXTest {

@Test
public void test() throws Exception {

Workbook workbook = new Workbook();
workbook.open(“d:/Store Income Statement template in English.xlsx”);
}

}
================================================================================

One more thing when I save this file as .xls it works fine.Can you check this issue and tell me where is a problem.

Thanks
Branko

Hi Branko,


Attached to my reply is latest fix version of Aspose.Cells JAVA v2.5.3.6. We have tested your scenario with this fix release and we are unable to find any issue. Please give it a try and let us know of your feedback. Thank you

OK thank you for answer.

I tried with version 2.5.3.6 and workbook can be opened now.

However I have another problem with same file. There is one extra TextBox that is not visible in document. I will send you the test and the same xlsx file with all text deleted. Still there is that extra text box that I have no idea from where it comes from. I checked there is no any comments and hidden text in excel file.
============================================
import org.junit.Test;

import com.aspose.cells.TextBoxes;
import com.aspose.cells.Workbook;
import com.aspose.cells.Worksheet;
import com.aspose.cells.Worksheets;

public class XlsXTest {

@Test
public void test() throws Exception {

Workbook workbook = new Workbook();
workbook.open(“d:/Store Income Statement template in English.xlsx”);

Worksheets worksheets = workbook.getWorksheets();

Worksheet worksheet = worksheets.getSheet(0);

TextBoxes textBoxes = worksheet.getTextBoxes();

int size = textBoxes.size();

String text = textBoxes.get(0).getContent();

}
}
=================================================

Also xlsx file in previous post appears to have same text as last text box found.

Please check this and explain it to me.

Thanks
Branko

btw extra text is :

<?xml version="1.0" encoding="UTF-8"?> page_UTF8=Grid1:0 /hr/common/HRLogon.jsp?elementName_UTF8=%2fAccounting%20Reports%2fStore%20Reports%2fStore%20Income%20Statement&elementType=2&viewAs=html&sso_token=$SSO_TOKEN$&$CONTEXT$&action=refresh&localattribute=Periods.id.P12&localattribute=Division.id.Division&localattribute=Company.id.Company&localattribute=Organization.id.CC%2002730&localattribute=Fiscal%20Year.id.2010&localattribute=Currency.id.USD&&allPages=false&splitPages=false&refUsingWSPOV=false&LOCALE_LANGUAGE=en_US /workspace/index.jsp?module=tools.relatedcontent&repository_path=%2fAccounting%20Reports%2fStore%20Reports%2fStore%20Income%20Statement&elementType=2&repository_name=%2fAccounting%20Reports%2fStore%20Reports%2fStore%20Income%20Statement&$CONTEXT$&layout=embedded&bpm.logoff=false&bpm_showtab=false&repository_format_id=html&mimetype=application/hyperion-reports-report&action=edit&localattribute=Periods.id.P12&localattribute=Division.id.Division&localattribute=Company.id.Company&localattribute=Organization.id.CC%2002730&localattribute=Fiscal%20Year.id.2010&localattribute=Currency.id.USD&&allPages=false&splitPages=false&refUsingWSPOV=false /hr/common/HRClientRefTracker.jsp?removeInstanceId=2087873

Hi,

I have tested your code with your template file and found
Aspose.Cells gives “1” for TextBoxes.size(). We need to scan your template
file and investigate if there is some
hidden textbox there or why it is returning “1”. I have logged a ticket with an id:
CELLSJAVA-27789. Your issue is not declared as bug yet as we need to analyze your template file completely. We will keep you posted on it.

Thank you.



Hi,

In fact in your template file there does exist one hidden textbox. Maybe it has been set to hidden by other ways such as executing macro.

To confirm and check this textbox, you may try following macro code to make it visible.

Worksheets(1).Shapes(2).Visible = True


However we did not find any menu in ms excel to access this property and currently we do not support to access this property by cells API.