Shared forumlas in xlsx files (cells v4.3)

Received : 2007/07/30 14:00:05
Message : getting message "Could not parse Excel file: shared forumula is not supported yet" when opening up an xlsx file using cells v4.3, when will this feature be supported? are there any known work arounds?


This message was posted using Aspose.Live 2 Forum

Hi,

Thanks for considering Aspose.

Well, Currently the feature is not supported as we are working on it. Hopefully it will be available in our next official version which is likely to be released within a couple of weeks or so.

Thank you.

does version 4.4 fix this problem?

Not yet. But we are near to make it. I will post here a fix which solves this problem soon.

Please try this attached fix.

our initial testing shows that this solves our problem.

this is not the official 4.4 release though, how long until there is an official release that includes this fix? should i wait for it or consider this attachement releaseable?

thank you.

A strange thing happened, we were using the attached file and it seemed to work OK with formulas, but now I consistently get 0 whenever there's a formula. We're using this DLL but for some reason it does not work, do you have any idea what could have happened?

thanks

Hi,

Could you explain the issue in detail and post your template excel file here. We will check it soon.

Thank you.

There is nothing fancy about the excel templates - what we're doing in C# is basically:

Cells.Worksheet worksheet = ...
Cell cell = worksheet.Cells[x,y]
String s = cell.StringValue;
and then we parse the string value. for any simple equation even something like "=1+1" we get back the string "0"

thanks for your quick response,

Alex

Hi Alex,

Well, I don't find any problem what so ever. Following is my testing code which works fine:

Workbook wb = new Workbook();
wb.Open("d:\\test\\test_data.xls");
Worksheet worksheet = wb.Worksheets[0];
Cell cell = worksheet.Cells[2,0];
String s = cell.StringValue;
s = s + 1;
MessageBox.Show(s);
Please create a sample template file and paste your code here to show your issue and also to explain what you really meant. We will check it soon.
Thank you.

This is for Cells v4.4.0.22

Sorry, I wasn't very clear. here is the failure as an NUnit test.

I cannot upload the sample excel file, but you can create it by opening up Excel 2007 and putting "=1+1" in the first cell

[Test]
public void Excel2007GetValueForEquation()
{
string filename = "C:\\test.xlsx";
Aspose.Cells.Workbook wb = new Aspose.Cells.Workbook();
wb.Open(filename, Aspose.Cells.FileFormatType.Excel2007Xlsx);
Aspose.Cells.Worksheet ws = wb.Worksheets[0];
Aspose.Cells.Cell cell = ws.Cells[0, 0];

String s = cell.StringValue;
// Assert.AreEqual("2", s);
Console.Out.WriteLine(string.Format("s = {0}, expect s = 2", s));


int integerValue = cell.IntValue;
Console.Out.WriteLine(string.Format("integerValue = {0}, expect integerValue = 2", integerValue));
// Assert.AreEqual(2, integerValue);
}

I get s = "0" and integerValue = 0

thanks for your quick responses, let me know if you need any clarification.

Hi,

Please call Workbook.CalculateFormula() before extracting and testing the values.

E.g.,

[Test]
public void Excel2007GetValueForEquation()
{
string filename = "C:\\test.xlsx";
Aspose.Cells.Workbook wb = new Aspose.Cells.Workbook();
wb.Open(filename, Aspose.Cells.FileFormatType.Excel2007Xlsx);
Aspose.Cells.Worksheet ws = wb.Worksheets[0];
Aspose.Cells.Cell cell = ws.Cells[0, 0];

wb.CalculateFormula();

String s = cell.StringValue;
// Assert.AreEqual("2", s);
Console.Out.WriteLine(string.Format("s = {0}, expect s = 2", s));


int integerValue = cell.IntValue;
Console.Out.WriteLine(string.Format("integerValue = {0}, expect integerValue = 2", integerValue));
// Assert.AreEqual(2, integerValue);
}

Thank you.

That does fix that test.

We are considering always calling CalculateFormula() when opening a workbook, is there any reason we should not? The documentation on CaluclateFormula

is not clear on the performance implications / contract.

Thank you again for your prompt and helpful support.