+ Reply to Thread
Results 1 to 4 of 4

Shapes.AddPicture, path link in Variable

  1. #1
    Registered User
    Join Date
    10-22-2016
    Location
    Amsterdam
    MS-Off Ver
    2016
    Posts
    2

    Shapes.AddPicture, path link in Variable

    Dear people,

    I am trying to get photo's from the internet into my excel worksheet.
    It works when I am not using a variable as link path, but when I do it gives me errors.

    I need to have it in a variable because I am grabbing the link out of an HTML source code.
    That al works, but the ActiveSheet.Shapes.AddPicture (foto_link) gives me errors.

    My code;
    foto_link = ("http://lengersyachts.com/" & Foto_string)
    ActiveSheet.Shapes.AddPicture (foto_link) _
    , msoFalse, msoTrue, 400, 0, 775, 184

    This code works;
    ActiveSheet.Shapes.AddPicture "http://www.yachtworld.com/lengersyachts/images/L74812.jpg" _
    , msoFalse, msoTrue, 0, 0, 475, 184


    But I need to get that link read out of a variable
    I already tried different variable data settings.

    Please, can somebody help me out ?
    Thank you in advance.

  2. #2
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Shapes.AddPicture, path link in Variable

    This works for me:
    Please Login or Register  to view this content.
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  3. #3
    Registered User
    Join Date
    10-22-2016
    Location
    Amsterdam
    MS-Off Ver
    2016
    Posts
    2

    Re: Shapes.AddPicture, path link in Variable

    YESS,

    Now it works, forgot to set the sPiclink to set as string.

    Thank you very much !!

  4. #4
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Shapes.AddPicture, path link in Variable

    Happy to help.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. You can also 'Add Reputation' to those who helped you. Thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Select Image After Inserting with Addshapes.Addpicture
    By nicotob in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-25-2014, 05:18 AM
  2. Variable .Attachment.Add path using Function to pull path from word table
    By aavelyn in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-27-2013, 10:07 PM
  3. Deleting Shapes and Copying between variable worksheets
    By bhenderson in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-20-2012, 08:52 PM
  4. REQUEST: Macro to Link Excel Cell to Shapes
    By MBCMDR in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-29-2011, 05:21 AM
  5. Selecting Shapes With Variable Based On Worksheet Data
    By svAndiamo in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-15-2011, 03:49 PM
  6. picture resize. variable selection delete shapes
    By Code Flunkie in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-24-2010, 04:19 PM
  7. [SOLVED] variable path in a link
    By Christy in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-03-2005, 07:06 AM

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