We are meeting a problem while trying to calculate french dates in formulas.
French format is "AAAAMMJJ" and it should return for exemple 20240702 but instead we get chinese values 星期一07JJ
This code replicates the issue ( The attached file is sotred in Resource folder at the root of the project ) :
- Code: Select all
using System;
using System.IO;
using Spire.Xls;
namespace ExempleSpireExcel
{
class Program
{
static void Main(string[] args)
{
try
{
string cheminBase = AppDomain.CurrentDomain.BaseDirectory;
string cheminProjet = Path.GetFullPath(Path.Combine(cheminBase, @"..\..\.."));
string cheminFichier = Path.Combine(cheminProjet, "resources", "test.xlsx");
Console.WriteLine($"Chargement du fichier : {cheminFichier}");
Workbook wb = new Workbook();
wb.LoadFromFile(cheminFichier);
wb.CalculateAllValue();
string cheminSortie = Path.Combine(cheminProjet, "resources", "test_Calcule.xlsx");
wb.SaveToFile(cheminSortie, ExcelVersion.Version2016);
Console.WriteLine($"Terminé ! Fichier sauvegardé : {cheminSortie}");
}
catch (Exception ex)
{
Console.WriteLine("Erreur : " + ex.Message);
}
}
}
}
Then, to avoid Excel recalcuating the file, we convert it to a zip and look to the computed value :
- Code: Select all
<row r="1" ht="15">
<c r="A1" t="str">
<f ca="1">TEXT(TODAY(),"aaaammjj")</f>
<v>星期一12jj</v>
</c>
</row>
Please let us know if you got a workaround for this.
Thanks