2012-09-05 19 views
1

以下是xls文件中的一些代碼。在Excel 2010中它不起作用。我無法找到在對象資源管理器替代Excel 2010中的圖片集合

Private Sub Worksheet_Calculate() 

     Dim oPic As Picture 
     'make them invisible 
     For Each oPic In Me.Pictures 
        If Left(oPic.Name, 2) = "jq" Then 
           oPic.Visible = False 
        End If 
     Next 

end sub 

將相當於2010碼是什麼集合Pictures

+0

相關:http://stackoverflow.com/questions/1138914/where-can-i-find-documentation-for-excels-pictures-collection – Juliusz

回答

4

在Excel中使用此遍歷圖片

Sub Sample() 
    Dim shp As Shape 

    For Each shp In ActiveSheet.Shapes 
     If shp.Type = msoPicture Then 
      Debug.Print shp.Name 
     End If 
    Next 
End Sub 
+0

謝謝Siddharth ......我說得對,這是xl最新版本的新功能嗎? – whytheq

+0

這適用於所有版本 –

+0

好吧 - 所以照片集合已被刪除,但形狀一直正常? – whytheq