+ Reply to Thread
Results 1 to 3 of 3

How do I name a picture as I paste it from VBA? (ActiveSheet.Past.

  1. #1
    Leitey
    Guest

    How do I name a picture as I paste it from VBA? (ActiveSheet.Past.

    I want to use VBA (and maybe some variation of the ActiveSheet.Paste
    command?) to paste the image on the clipboard into Excel under a certain name
    i.e. "samplepicture". I have tried "ActiveSheet.Paste.samplepicture" and
    "ActiveSheet.Shapes("samplepicture").Paste" but can't seem to find a good
    syntax.

  2. #2
    Earl Kiosterud
    Guest

    Re: How do I name a picture as I paste it from VBA? (ActiveSheet.Past.

    Leitey,

    When you paste, it'll be selected.

    ActiveSheet.Paste
    Selection.Name = "samplepicture"
    --
    Earl Kiosterud
    www.smokeylake.com/
    -------------------------------------------

    "Leitey" <[email protected]> wrote in message
    news:[email protected]...
    >I want to use VBA (and maybe some variation of the ActiveSheet.Paste
    > command?) to paste the image on the clipboard into Excel under a certain
    > name
    > i.e. "samplepicture". I have tried "ActiveSheet.Paste.samplepicture" and
    > "ActiveSheet.Shapes("samplepicture").Paste" but can't seem to find a good
    > syntax.




  3. #3
    Dave Peterson
    Guest

    Re: How do I name a picture as I paste it from VBA? (ActiveSheet.Past.

    One more way...

    After you've pasted the picture, it's the picture with the highest index.

    dim myPict as picture
    with activesheet
    .paste
    set mypict = .pictures(.pictures.count)
    end with
    mypict.name = "SamplePicture"



    Leitey wrote:
    >
    > I want to use VBA (and maybe some variation of the ActiveSheet.Paste
    > command?) to paste the image on the clipboard into Excel under a certain name
    > i.e. "samplepicture". I have tried "ActiveSheet.Paste.samplepicture" and
    > "ActiveSheet.Shapes("samplepicture").Paste" but can't seem to find a good
    > syntax.


    --

    Dave Peterson

+ 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