Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 709
Default Footer Picture

How do I copy the footer/header picture from one worksheet to another?

The following code will put the existing picture into the Graph object but
when I try to set the Graph object of the new workbook I get an error...

Sub CopyFooterPicture()
On Error GoTo Trap
Dim wkOld As Worksheet, wkNew As Worksheet
Dim gphOld As Graphic, gphNew As Graphic

' get existing picture
Set wkOld = ThisWorkbook.Sheets("sheet1")
Set gphOld = wkOld.PageSetup.CenterFooterPicture

' new worksheet and picture
Set wkNew = ThisWorkbook.Worksheets.Add
' display the footer
wkNew.PageSetup.CenterFooter = "&G"
' get the new picture
Set gphNew = wkNew.PageSetup.CenterFooterPicture
' this bombs, since the Old filename is just the filename of the original
picture file w/o the extension
gphNew.Filename = gphOld.Filename

Exit Sub
Trap:
Debug.Print Err.Number & ": " & Err.Description
End Sub

Thanks,

--
Richard
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Picture only in footer of last page? Al Excel Discussion (Misc queries) 4 August 1st 07 12:40 AM
Need help inserting picture into header/footer SP New Users to Excel 2 September 18th 06 09:22 PM
How to insert a picture in the Footer (not the Header) in Excel 20 jmon Excel Worksheet Functions 2 March 17th 05 05:59 AM
How to keep a picture in Excel 97 page footer/header? Umesh[_3_] Excel Programming 6 October 12th 04 02:36 AM
Inserting picture in footer with macro Martin[_13_] Excel Programming 2 May 13th 04 03:24 PM


All times are GMT +1. The time now is 04:13 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"