Hi,
I have an existing xlsx file that contains graphics (drawing)
I simply open the workbook,
var workbook = CreateWorkbook();
byte[] bytes;
using (var output = new MemoryStream())
{
new XlsxFormatProvider().Export(workbook, output);
bytes = output.ToArray();
}
File.WriteAllBytes("c:\\Logs\\test.xlsx", bytes);
private Workbook CreateWorkbook()
{
Workbook workbook;
IWorkbookFormatProvider formatProvider = new XlsxFormatProvider();
FileStream? stream = null;
try
{
stream = File.Open("AnalyseImpayeTemplate.xlsx", FileMode.Open);
workbook = formatProvider.Import(stream);
}
catch (IOException ex)
{
throw new IOException("The file cannot be opened. It might be locked by another application.", ex);
}
finally
{
stream?.Dispose();
}
return workbook;
}
When I open the result file, with release 2024.3.806, I got an error. It delete drawing parts :
Partie supprimée: /xl/drawings/drawing1.xml partie. (Forme de dessin)
With release 2024.2.426, it works fine.
Any ideas why?
Hello Richard,
I am sorry to hear you are experiencing unexpected results. I would gladly like to help you with this case however without having any resources at my disposal that I can examine, my assistance is very limited and I can only make assumptions.
With that in mind, in order for me to get a better context and understanding of the scenario you are experiencing, would you be able to share with us a sample document you are using to reproduce this behavior? This way I can try to achieve the same results on my end, investigate the issue further, try to identify the cause, and get back to you with details and feedback.
Please keep in mind that this is a Q&A Forum and anything attached will be made public to everyone. Do let me know if you have any concerns about that. If so you can try to open a separate private support ticket about this so we can continue our conversation in private.
Thank you in advance for your cooperation. I am looking forward to your reply.
Regards,
Yoan
Here it is.
It reference 2024.2.426. Run it and open test.xlsx file generated => no problems.
Then, update package version to the last one (2024.3.806). Run it again and open test.xlsx file => Error.