Compatibility with Excel 2007

Hi,

The following script export data from notes documents to Excel. Till Excel 2003, this script was well running. With Excel 2007, all instructions with creation of functions in Excel are corrupted, and there’s the following message : OLE:Automation object Error. If I copy manually the function Excel, it’s OK.

see the example:

appExcel.Application.worksheets(“Feuille de calcul”).Cells(NumLigne+3, 4).font.bold=True

appExcel.Application.worksheets(“Feuille de calcul”).Cells(NumLigne+3, 4).font.colorindex=5

appExcel.Application.worksheets(“Feuille de calcul”).Cells(NumLigne+3, 4).Value = “Total net”

appExcel.Application.worksheets(“Feuille de calcul”).Cells(NumLigne+1, 5).font.bold=True

appExcel.Application.worksheets(“Feuille de calcul”).Cells(NumLigne+1, 5).NumberFormat=“0”

appExcel.Application.worksheets(“Feuille de calcul”).Cells(NumLigne+1, 5).Value = “=SOMMEPROD(D7:D” & (Numligne) & “;E7:E” & (NumLigne) & “)”

The last line generates the error on execution.

It’s the same result with all functions

Any idea ?

Subject: Compatibility with Excel 2007

You should be using .FormulaR1C1Local instead of .Value to set the formula.

Subject: RE: Compatibility with Excel 2007

Hi Stan,

sorry for my previous message.

I made new tests , and it’s well running.

Thank you a lot for your help … it’s removing me a thorn in my feet , or something like that …

Subject: RE: Compatibility with Excel 2007

Hi,

Thank you for your suggestion.

I tested this solution but that generates only the absolute value and not the formular in Excel, and I need to generate the formular, indeed, the enduser can simulate calculations in the Excel sheet.

Any idea to recover the formula ?