Results 1 to 5 of 5

Thread: Insert Picture In Chart Fill Area / Plot Area / Format Area

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Junior Member
    Join Date
    Feb 2012
    Posts
    2
    Rep Power
    0

    Insert Picture In Chart Fill Area / Plot Area / Format Area

    I am trying to use macro to set the chart fill with specified picture. The pictures are processed and located in the same excel sheet.
    Is there anyway to do this?
    Beginner on Macro. Thanks very much.


    https://www.youtube.com/channel/UCnxwq2aGJRbjOo_MO54oaHA
    Last edited by DocAElstein; 06-12-2023 at 05:50 PM.

  2. #2
    Junior Member swinnersmusic's Avatar
    Join Date
    May 2012
    Posts
    6
    Rep Power
    0

    Red face macro text

    Quote Originally Posted by nomad View Post
    I am trying to use macro to set the chart fill with specified picture. The pictures are processed and located in the same excel sheet.
    Is there anyway to do this?
    Beginner on Macro. Thanks very much.

    Hello:
    I got this code below when I recorded a macro while filling the chart area with a userpic of Paris Hotel
    The chart was embedded in the sheet.
    Its basically performing a Format Chart Area......fill. (note that this different to plot area) The picture will go behind the plot area. ie around the edge of the plot area

    here is the code:
    Hope this helps
    Alan Swinburne


    Code:
    Sub Macro1()
    '
    ' Macro1 Macro
    '
        ActiveSheet.ChartObjects("Chart 1").Activate
        With ActiveSheet.Shapes("Chart 1").Fill
            .Visible = msoTrue
            .PresetTextured msoTexturePapyrus
            .TextureTile = msoTrue
            .TextureOffsetX = 0
            .TextureOffsetY = 0
            .TextureHorizontalScale = 1
            .TextureVerticalScale = 1
            .TextureAlignment = msoTextureTopLeft
        End With
        With ActiveSheet.Shapes("Chart 1").Fill
            .Visible = msoTrue
            .UserPicture "C:\Users\Alans\Pictures\paris hotel.jpg"
            .TextureTile = msoFalse
        End With
    End Sub
    Last edited by Admin; 05-01-2012 at 05:52 PM. Reason: code tag added

  3. #3
    Junior Member
    Join Date
    Feb 2012
    Posts
    2
    Rep Power
    0
    Hi,Swinnersmusic, it does help, many many thanks:D. Sorry for the late reply, because I cannot access to the website yesterday, and I got the message from my email.

  4. #4
    Administrator Admin's Avatar
    Join Date
    Mar 2011
    Posts
    1,123
    Rep Power
    10
    Hi swinnersmusic,

    Welcome to ExcelFox !!

    Please use code tags while posting codes
    Cheers !

    Excel Range to BBCode Table
    Use Social Networking Tools If You Like the Answers !

    Message to Cross Posters

    @ Home - Office 2010/2013/2016 on Win 10 (64 bit); @ Work - Office 2016 on Win 10 (64 bit)

  5. #5
    Administrator Excel Fox's Avatar
    Join Date
    Mar 2011
    Posts
    1,402
    Rep Power
    10
    And nomad, can you check if swinnersmusic's has helped?
    A dream is not something you see when you are asleep, but something you strive for when you are awake.

    It's usually a bad idea to say that something can't be done.

    The difference between dream and aim, is that one requires soundless sleep to see and the other requires sleepless efforts to achieve

    Join us at Facebook

Similar Threads

  1. Replies: 3
    Last Post: 06-01-2013, 11:31 AM
  2. Insert Picture in a Cell UDF
    By Admin in forum Download Center
    Replies: 10
    Last Post: 12-07-2012, 04:49 PM
  3. Replies: 4
    Last Post: 07-27-2012, 08:43 AM
  4. Print Selective Area
    By r_know in forum Excel Help
    Replies: 2
    Last Post: 06-21-2012, 11:09 PM
  5. Save Chart As A Picture VBA
    By Admin in forum Excel and VBA Tips and Tricks
    Replies: 0
    Last Post: 05-14-2011, 04:28 PM

Posting Permissions

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