We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Aspose.Excel : problem with pictures in Header

I need to create an excel-report with a background image on the first page and some extra text over it.
When I try the same in Excel I can achieve it by setting a custom header and then inserting a picture in this custom header.
I try to do the same with Aspose.Excel but don’t seem to be able to do this from code : I can add a custom header but I cannot add pictures through these methods.
So instead I tried to create a template xls file containing the required picture as background of the first worksheet.
When I call the Save() method on my Excel object the picture doesn’t show up anymore.
When I open my template directly I see my background picture, but when I open my programmatically create worksheet the picture is gone.
What am I doing wrong? Or is it simply not possible?

Kind regards

Hi Marc,

Thanks for considering Aspose.

Well, I 'm afraid adding pictures to headers/footers may not supported in the older version you are using. But the newer Aspose.Cells supports to add pictures into the headers / footers, kindly check:

Actually Aspose.Cells supports your task in both ways. You can also set the background picture using Aspose.Cells APIs. Following is a sample code:

Workbook workbook = new Workbook();
FileStream fs = File.OpenRead(@"F:\\FileTemp\\chart.bmp");
byte[] imageData = new byte[fs.Length];
fs.Read(imageData, 0, imageData.Length);


Kindly upgrade to the latest version of Aspose.Cells and try it.

The new Aspose.Cells is more reliable, stable and prosperous with enhanced and advanced functionality. I think there is not much labour involved upgrading to the newer Aspose.Cells. However, when you upgrade to the newer Aspose.Cells, Please note:

Some APIs (classes, struct, enumerations) are added based on some advanced features that we now offer, the previous classes (with their members) are retained and optimized but a few classes are renamed, some additional members (properties, methods etc.) are also included of the classes.

Following is the classes list which are renamed:

1. Excel class is replaced by Workbook class.

2. ExcelDesigner class is replaced by WorkbookDesigner class.

3. ExcelHelper class is replaced by CellsHelper class.

So you may change your code according. And for more info, please check the APIs:

and Programmer’s guide:

Hopefully this will help you.

Thank you.