setting the Left or Right HeaderPicture

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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 Bitmap(@"C:\image.gif");
pageSetup.LeftHeaderPicture = bitmap;

neither of these seem to work.

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

Cheers

Mark
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top