Thanks Thanks:  0
Likes Likes:  0
Results 1 to 9 of 9

Thread: Help! Hide a picture using vba?

  1. #1
    Board Regular
    Join Date
    Mar 2009
    Posts
    93
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Post Help! Hide a picture using vba?

    I'm trying to hide/unhide a picture I imported into an excel spreadsheet. Right now I'm just working on hiding it. Here is the code I've been trying to use:

    ActiveSheet.msoPicture("Picture59_Click").Visible = False

    Any ideas?

    Thanks

  2. #2
    MrExcel MVP
    Moderator
    Andrew Poulsom's Avatar
    Join Date
    Jul 2002
    Posts
    73,092
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)

    Default Re: Help! Hide a picture using vba?

    Is it?

    ActiveSheet.Pictures("Picture59_Click").Visible = False

    If it doesn't work check that you have the right name.

  3. #3
    Board Regular
    Join Date
    Mar 2009
    Posts
    93
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Help! Hide a picture using vba?

    I tried the code and I'm getting a "Run-time error '1004': Unable to get the Pictures property of the Worksheet class"

  4. #4
    MrExcel MVP
    Moderator
    Andrew Poulsom's Avatar
    Join Date
    Jul 2002
    Posts
    73,092
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)

    Default Re: Help! Hide a picture using vba?

    As I said, check the name "Picture59_Click", and change it if necessary.

  5. #5
    Board Regular
    Join Date
    Jun 2002
    Posts
    2,128
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Help! Hide a picture using vba?

    Maybe you need to get at it through the Shapes collection?

  6. #6
    Board Regular
    Join Date
    Mar 2009
    Posts
    93
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Help! Hide a picture using vba?

    Should the name of the picture be the name of the actual picture I import? Do I need in include the .jpg?

  7. #7
    MrExcel MVP
    Moderator
    Andrew Poulsom's Avatar
    Join Date
    Jul 2002
    Posts
    73,092
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)

    Default Re: Help! Hide a picture using vba?

    If you click on the picture its name will appear in the Name box to the left of the Formula Bar.

  8. #8
    Board Regular
    Join Date
    Mar 2009
    Posts
    93
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Help! Hide a picture using vba?

    It looks like I used an underscore instead of a space. It works perfectly now. Thanks for your help!!!

  9. #9
    New Member
    Join Date
    Nov 2017
    Posts
    1
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Help! Hide a picture using vba?

    hi. what about all instances of a particular image, which is shown multiple times in the same worksheet?
    It cant be all images in the worksheet, because i've got some different ones i want to retain.

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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