2016-08-25 52 views

回答

0

很多頭抓撓後自己找到了答案。頭圖像不形狀對象它們是圖形對象

https://msdn.microsoft.com/en-us/library/office/ff193679.aspx

使用PageSetup對象成員引用圖形例如

https://msdn.microsoft.com/en-us/library/office/ff196670.aspx?f=255&MSPPError=-2147217396

最終代碼:

Sub GetHeaderImage() 

Dim ws As Worksheet 
Dim ps As PageSetup 
Dim headpic As Graphic 

Set ws = ActiveSheet 
Set ps = ws.PageSetup 
Set headpic = ps.RightHeaderPicture 

End Sub