When call
chart.Series.Add
and save workbook in xls file.
In Excel 2007 32bit, open result file produce an error:
"File error: data may have been lost"
This problem doesn't occurs if save file in xlsx format.
In the sample, the problem come from line 108 in TestClass1.
Best regards,
Alexandre
Hello Alexandre,
Thank you for your project. I have successfully reproduced the behavior you described and passed this ticket to our developers for further research.
Please bear with us. We will notify you as soon as we make any progress.
However, while researching your scenario, we found the following issues:
//string feuilleSourceAxe = correspondance.Groups[1].Value; ................... //string feuilleSource = correspondance.Groups[1].Value;
with these ones:
string feuilleSourceAxe = correspondance.Groups[1].Value.Trim(new char[] { '\'' }); ................. string feuilleSource = correspondance.Groups[1].Value.Trim(new char[] { '\'' });
foreach (Tuple<string, string> tupleCourant in listeElement) { //Range rngTitre = feuilleCible.Range[tupleCourant.Item2]; //Range rngArguments = feuilleCible.Range[adresseDonneesAxeX]; //Range rngValeurs = feuilleCible.Range[tupleCourant.Item1]; Range rngTitre = classeur.Range.Parse(tupleCourant.Item2); Range rngArguments = classeur.Range.Parse(adresseDonneesAxeX); Range rngValeurs = classeur.Range.Parse(tupleCourant.Item1); graphiqueCourant.Series.Add(rngTitre, rngArguments, rngValeurs); graphiqueCourant.Series.Add(rngTitre, rngArguments, rngValeurs); }