ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   setting the Left or Right HeaderPicture (https://www.excelbanter.com/excel-programming/385863-setting-left-right-headerpicture.html)

mark_newbs

setting the Left or Right HeaderPicture
 
Hi,
I am working in c# and I am trying to set the HeaderImage of a worksheet. I
have tried several methods:

Excel.PageSetup pageSetup = (Excel.PageSetup)xlSheet.PageSetup;
pageSetup.LeftHeaderPicture.Filename = @"C:\image.gif";

as well as:

Bitmap bitmap = new ");
pageSetup.LeftHeaderPicture = bitmap;

neither of these seem to work.

There is very little documentation on this feature, can anyone help?

Cheers

Mark

NickHK

setting the Left or Right HeaderPicture
 
Marks,
According to the VBA Help:
<Quote
With ActiveSheet.PageSetup.LeftHeaderPicture
.FileName = "C:\Sample.jpg"
......... etc

' Enable the image to show up in the left header.
ActiveSheet.PageSetup.LeftHeader = "&G"

End Sub
Note It is required that "&G" is a part of the LeftHeader property string
in order for the image to show up in the left header.

</Quote

NickHK

"mark_newbs" wrote in message
...
Hi,
I am working in c# and I am trying to set the HeaderImage of a worksheet.

I
have tried several methods:

Excel.PageSetup pageSetup =

(Excel.PageSetup)xlSheet.PageSetup;
pageSetup.LeftHeaderPicture.Filename = @"C:\image.gif";

as well as:

Bitmap bitmap = new ");
pageSetup.LeftHeaderPicture = bitmap;

neither of these seem to work.

There is very little documentation on this feature, can anyone help?

Cheers

Mark





All times are GMT +1. The time now is 01:49 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com