+ Reply to Thread
Results 1 to 3 of 3

Excel 2007 : test if picture exists on sheet

Hybrid View

  1. #1
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: test if picture exists on sheet

    Another way:

      Dim shp As Shape
    
      On Error Resume Next
      Set shp = ActiveSheet.Shapes("myPicture")
      On Error GoTo 0
    
      If shp Is Nothing Then
        ' it doesn't exist
      Else
        ' it does
      End If
    ... or

      Dim pic As Picture
    
      On Error Resume Next
      Set pic = ActiveSheet.Pictures("myPicture")
      On Error GoTo 0
    
      If pic Is Nothing Then
        ' it doesn't exist
      Else
        ' it does
      End If
    Last edited by shg; 12-28-2014 at 08:28 PM.
    Entia non sunt multiplicanda sine necessitate

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1