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

Free Support Forum - aspose.com

Does background image exist

Hi guys,

I have a question for you.

I used the following code to add the background image to the excel file:

Workbook workbook = new Workbook();
FileStream fs = File.OpenRead(@“C:\Temp\watermark.jpg”);

byte[] imageData = new byte[fs.Length];
fs.Read(imageData, 0, imageData.Length);


How can I define that my excel file contains background image that I added? Or may be some metadata/flag exists in the excel file that are not visible for user and I can write or read it programmatically?

For example for word docs I can insert some watermark and find it by Name.

Shape watermark = new Shape(doc, Aspose.Words.Drawing.ShapeType.TextPlainText);
watermark.Name = string.Format(“WaterMark_{0}”, Guid.NewGuid()); …

if (shape.Name.Contains(“WaterMark”))



Hi Alex,

You can use Worksheet.setBackground(null) method to remove the background image of the worksheet. Following code snippet will help you.

Code snippet:
//Instantiate a new Workbook
Workbook workbook = new Workbook();
//Open an existing excel file
Worksheet sheet = workbook.getWorksheets().getSheet(0);

//Remove the background image for the sheet.

//Save the excel file

If you face any issue please feel free to contact us.

Thank you,

Hi guys,

My question was not how to remove background from excel file. My question was how to define if the background with "someName" exist in excel file.

Please read my question in the first post.



Hi Alex,

We do not support to parse the background image of the template file. We only support preserving them and saving it back to the file. As there is only one background image of the worksheet ,so there is no "name" setting available, you can only replace it.