No, it's not just bitmaps. For example with a transparent shape on a sheet and the PastePicture module in place:
Sub AddPicToHeader()
Dim strPicPath As String
Dim strImageName As String
Dim strImageSheetName As String
' change this to match your image control name
strImageName = "Rectangle 2"
' change this to match the name of the sheet with the image on
strImageSheetName = "Sheet1"
strPicPath = ThisWorkbook.Path & Application.PathSeparator & "temp.wmf"
' delete pic file if it already exists
If Dir(strPicPath) <> vbNullString Then Kill strPicPath
' save picture to file
ThisWorkbook.Worksheets(strImageSheetName).Shapes(strImageName).CopyPicture xlScreen, xlPicture
SavePicture PastePicture, strPicPath
' now assign to active sheet header
With ActiveSheet.PageSetup
.LeftHeaderPicture.Filename = strPicPath
.LeftHeader = "&G"
End With
' remove temporary file
Kill strPicPath
End Sub
Bookmarks