gugtenterf Posted September 8 Report Share Posted September 8 Hi, I have a simple Excel file with just one sheet and one image in .xls and in .xlsx (attached in the zip file). When reading the files using the XlsFormatProvider or XlsxFormatProvider, I get a workbook. When iterating the shapes on every sheet, I have a different result. I can retrieve the image using the XlsxFormatProvider in the xlsx file, but I'm not getting any shapes in the .xls file using the XlsFormatProvider. Some code below: var provider = new XlsxFormatProvider(); using (var fs = File.OpenRead("image.xlsx")) { var workbook = provider.Import(fs); Assert.AreEqual(workbook.ActiveWorksheet.Shapes.Images.Count(), 1); } Should I be doing this differently? Or is this a known limitation? I'm using version 2021.3.909.40. Quote Link to comment Share on other sites More sharing options...
gugtenterf Posted September 8 Author Report Share Posted September 8 Just now, gugtenterf said: Hi, I have a simple Excel file with just one sheet and one image in .xls and in .xlsx (attached in the zip file). When reading the files using the XlsFormatProvider or XlsxFormatProvider, I get a workbook. When iterating the shapes on every sheet, I have a different result. I can retrieve the image using the XlsxFormatProvider in the xlsx file, but I'm not getting any shapes in the .xls file using the XlsFormatProvider. Some code below: var provider = new XlsxFormatProvider(); using (var fs = File.OpenRead("image.xlsx")) { var workbook = provider.Import(fs); Assert.AreEqual(workbook.ActiveWorksheet.Shapes.Images.Count(), 1); } Should I be doing this differently? Or is this a known limitation? I'm using version 2021.3.909.40. https://file-types.com/docs/xls thanks in advance for any help Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.