• Object instead of a Picture

    Author
    Topic
    #463745

    Hi,
    I have about 7 pictures that I’ve inserted into an Excel spreadsheet. When I recorded my macro to copy and paste one of these pictures it shows the following code:

    Sheets(“logos”).Select
    ActiveSheet.Shapes(“Object 3”).Select
    Selection.Copy
    Sheets(“invoice template”).Select
    ActiveSheet.Paste

    It calls it “Object 3″… when I copy and paste a different picture, the recorded macro doesn’t show the following line:
    ActiveSheet.Shapes(“Object 3”).Select
    I think it’s because when I look at it in Excel it says it’s “Picture 1” instead of “Object 1”.

    How do I turn the picture into an object so I can make my macros work. Or, why doesn’t the recording capture the correct code and call it a picture???

    Thanks!
    Lana

    Viewing 1 reply thread
    Author
    Replies
    • #1184931

      I finally got it to work… I renamed the picture to “object 6”, then I had to change the code from:

      ActiveSheet.Shapes(“Object 6”).Select
      Selection.Copy

      to:

      ActiveSheet.Shapes(“Object 6”).Copy

      Then it worked.

      Thanks!
      Lana

    • #1184933

      The name displayed in the Name box in Excel’s formula bar is not necessarily the same as the name used by the Visual Basic Editor.

      If you explain what you want to accomplish, we may be able to come up with a suggestion.

    Viewing 1 reply thread
    Reply To: Object instead of a Picture

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: