CalculateFormula gives an error

Hi M00lie,

I think you want to get value in cell E24 of "invoerblad" worksheet. However, it's not the first sheet but the second. Please try following code:

Workbook wb = new Workbook();
wb.Open("d:\\test\\test.xls");
wb.CalculateFormula();

Console.WriteLine(wb.Worksheets["invoerblad"].Cells["e24"].Value);

Hi Michael,

On Oct 30 you send me a spreadsheetML file, I have tested on it and it works fine. You can try above code to see if it works fine for you. If not, please:

1. Check if you project does refer to the new dll.

2. If you are using the latest dll, please check if you file is same as the one you sent me. If not, please send the file to me.

3. If your code is different with mine, please also send you code to me.

Oops,

You are right Laurence. I overlooked the first sheet. My test code was a little too ‘quick’, I usually prefer wb.Worksheets[“invoerblad”] over wb.Worksheets[index].

Thanks for your splendid help.

Hello Laurence,

yes, the project refernces the most recent DLL. The Excel file that I test with is the same that I sent to you on Oct 30th. Nevertheless, here on my PC an error occurs.

I just sent another ZIP file to you. It contains a complete VB dot.net project. The release directory contains the Excel file (same one as on Oct 30th). Clicking the pushbutton opens the Excel file and performs a CalculateFormula. The error is with cell C69 on worksheet S6.

Is it possible that some formulas are evaluated differently on your PC than on my PC? Is it possible that this has anything to do with regional settings? Here I use German version of Windows XP, the Excel file has been created with German version of Excel 2003.

Michael G. Schneider

Hi Michael,

I got your email. However I cannot extract your vb code. Anyway I reproduce the problem with your new Excel file. I will fix it soon. Hopefully you will get a new fix next Monday.

I do not understand why you cannot extract the vb code. However, it is not necessary at all. The vb code is no more than two or three lines for opening / calculating the Excel file. If you are now able to reproduce the problem, this is fine.

Michael G. Schneider

Hi Michael,

Please try this attached fix.

I just downloaded the fix. I will try it with many Excel files that are used in the project.

Michael G. Schneider