Use VBA to Insert Photos into Excel from URL

แชร์
ฝัง
  • เผยแพร่เมื่อ 27 พ.ย. 2024

ความคิดเห็น • 105

  • @danilobunetto9143
    @danilobunetto9143 5 วันที่ผ่านมา

    Hello, great tutorial. I'm using it. Thanks. What changes can I do to use the code to all the rows of a table and jumping the rows without a link?

  • @lad1s1av7
    @lad1s1av7 2 หลายเดือนก่อน

    Excelent video in the term of detailed explanation of what are we doing so it helped me to understand how it works. Big thanks.

    • @lad1s1av7
      @lad1s1av7 2 หลายเดือนก่อน

      I've tried also script to delete pictures as once they are inserted in a document is grows on it's size. But I'm unable to make it work. Tried multiple different scripts and also shape approach but pictures are not deleted, while all the other objects are. Like buttons, charts, etc. Tried even to consult it with ChatGPT but with no result.

  • @elisehill992
    @elisehill992 2 ปีที่แล้ว +2

    This was a success !! Thank you, that was such a helpful video

    • @DSMStrength
      @DSMStrength  2 ปีที่แล้ว

      Glad it was helpful!

  • @romekk3975
    @romekk3975 7 หลายเดือนก่อน

    Thank you very much for sharing this. It did work without any issues. I just adapted it to my own code.

  • @MrErnicoco
    @MrErnicoco 3 ปีที่แล้ว +1

    Thanks for video! I was looking for such explanation very long.
    I really like the way you explain so I can repeat and understand more. I wish you great success

    • @DSMStrength
      @DSMStrength  3 ปีที่แล้ว

      Well thank you very much

    • @daviddiamond4268
      @daviddiamond4268 2 ปีที่แล้ว

      @@DSMStrength How do I insert the range of cell into the cell b2

  • @jillhodson524
    @jillhodson524 3 ปีที่แล้ว +2

    This was great! I was able to create without any problem. Thank you.
    Is there a modification needed if the cell range for the pictures has merged cells?

  • @wadeemaghi4846
    @wadeemaghi4846 2 ปีที่แล้ว

    it works, thank you! if I need to skip the empty cell and go to the next cell what should I change in the code?

  • @BboyGraphicx
    @BboyGraphicx 2 ปีที่แล้ว +1

    Thank you this was really helpful.

  • @miriamfahmi6630
    @miriamfahmi6630 2 ปีที่แล้ว +1

    Hi, what a useful tool. Thank you. It does not seem to work for MACs however, any tips?

    • @DSMStrength
      @DSMStrength  2 ปีที่แล้ว

      Unfortubately I use pc. Excel for Mac does not function the same way

  • @gyaninn4587
    @gyaninn4587 3 ปีที่แล้ว +1

    You deserve more value 👍 thanks a lot such a lovely module

    • @DSMStrength
      @DSMStrength  2 ปีที่แล้ว

      appreciate it thank you

  • @focused313
    @focused313 3 ปีที่แล้ว +1

    This was PERFECT. Thank you.

    • @DSMStrength
      @DSMStrength  3 ปีที่แล้ว

      thank you very much for checking out the video

  • @sultanzone2
    @sultanzone2 2 ปีที่แล้ว +1

    Great help
    Tha Thanks for sharing this

  • @philippebongrand4259
    @philippebongrand4259 3 ปีที่แล้ว +1

    Thanks a lot for this super tutorial !
    What can I add to center the photos in the column ?
    Thanks again for your super explanations !

    • @DSMStrength
      @DSMStrength  2 ปีที่แล้ว

      I believe it does center the photos?

  • @dbknight3
    @dbknight3 ปีที่แล้ว

    This is so helpful, thank you so much for doing this! I was wondering though, I was trying to accomplish this with a link to a file in my onedrive. I have a picture file in there that I have shared for everyone and I would like to use it for the image. It is giving me an error. Would there be a different procedure for that?

  • @vjaska
    @vjaska 2 ปีที่แล้ว +1

    Very helpful tutorial, thanks - just one question, is there a way of changing the size of the picture in the VBA code so that the pictures don't reach the sides of the cell the picture is located in?

    • @DSMStrength
      @DSMStrength  2 ปีที่แล้ว +1

      I am sorry I am not sure of a way right now

    • @vjaska
      @vjaska 2 ปีที่แล้ว

      @@DSMStrength don't worry, managed to find the answer elsewhere. Thanks though, it was still a useful video

  • @darkentbg
    @darkentbg ปีที่แล้ว

    This is MEGA awesome, is there a way to transport the images to another sheet? I tried to designate a sheet by going Sheets("my sheet name") instead of activesheet, but it doesnt work

  • @ΓρηγόρηςΚαλαποθαράκος
    @ΓρηγόρηςΚαλαποθαράκος ปีที่แล้ว +1

    great video! how do I massively import images though? I mean what if I have 1000 products? it is impossible to copy-paste 1000 times the URL for each product. thank you very much.

  • @turnswood
    @turnswood 3 ปีที่แล้ว

    I've been looking all over for something that does this. I didn't want to copy pictures in and then manipulate them, but from a link, fill in the picture from a link. I'm going to retrieve them from one of my disks, but it's still a hyperlink. Thanks a lot. Irv in Florida

  • @Jojosmith342
    @Jojosmith342 ปีที่แล้ว

    Excellent. Liked & definately subscribed. Thank you so much for your time to make this video. Could you please kindly teach us how to dynamically load photos from network drive based on user's input. Ex: There are hundreds thousands of products's photos, say user is searching for product #1, photo of this product ID will be loaded automatically from network drive. Thanks a lot for your help

  • @codyjenkins4376
    @codyjenkins4376 3 ปีที่แล้ว +3

    I received a 1004 error that says unable to get the Insert property of the Pictures class. is there an easy fix for this?

    • @DSMStrength
      @DSMStrength  3 ปีที่แล้ว

      Make sure that your links are for pictures

  • @kannanmassey5783
    @kannanmassey5783 2 ปีที่แล้ว

    Thanks a lot fora helpful vedio.

  • @novapearls
    @novapearls 3 ปีที่แล้ว +1

    Very great tutorial!!!
    If the link is broken or has no picture is there a code to skip that image and go to the next ?
    Thank u!!

    • @DSMStrength
      @DSMStrength  3 ปีที่แล้ว

      Let me check

    • @carlbarratt8403
      @carlbarratt8403 3 ปีที่แล้ว

      @@DSMStrength is there any update as I have the same issue?

    • @LIMHERST
      @LIMHERST 2 ปีที่แล้ว

      @@DSMStrength hey! do you have a fix for this? I'm having the same problem. Also - how can I change the range e.g. I have urls in other columns too. Thanks!

  • @francisliossi2561
    @francisliossi2561 3 ปีที่แล้ว +1

    Thanks a lot for this video!! But I still need your help! I'm trying to make the same thing, but using a Google Drive image link. However, i don't know why it doesn't work. Could you please help me?

    • @DSMStrength
      @DSMStrength  2 ปีที่แล้ว

      gdrive image link is not the url of a file.. you might be able to get it to work with a sharing link? but you should prob upload file to g-photos

  • @bakerhasan3093
    @bakerhasan3093 3 ปีที่แล้ว +1

    thank you
    very very very much

  • @M4N1p
    @M4N1p 4 หลายเดือนก่อน

    Great Video - I have one problem. I need my image to fit a merged cell. Any help on how this can be done?

    • @swerv5254
      @swerv5254 2 วันที่ผ่านมา

      Hey, it's been 4 months! Did you find a way? I'm trying to do just that

  • @mofeidyousifhassan7625
    @mofeidyousifhassan7625 2 ปีที่แล้ว +1

    Hello!
    Thank you so much for the video, I have tried it multiple times but it didn’t run for me, it says”can’t execute code in break mode”, may I get some help please via WhatsApp or any other app, that’s convenient for you?, I need this so bad for work, I’ll be so grateful for your help🙏🙏

  • @iiiiii-w8h
    @iiiiii-w8h 2 ปีที่แล้ว +1

    What would happen if you edit one of the urls? What needs to be done in order for the pictures to update accordingly?

    • @DSMStrength
      @DSMStrength  2 ปีที่แล้ว

      Delete pics and re run macro

  • @daniellipkind4276
    @daniellipkind4276 3 ปีที่แล้ว +1

    Great content! For some reason mine macro doesn't work as quick. It takes a while to load all the images meanwhile yours took less than a moment. How come? (I use Excel 2016 and each image is less than 50 kb in size)

    • @DSMStrength
      @DSMStrength  3 ปีที่แล้ว +1

      this can be due to several reasons including speed of your computer, other things going on in your spreadsheet, number of rows, number of pictures you are trying to run this script for etc. I kept my spreadsheet really lean for the purposes of the video.

  • @elektriskietikli8497
    @elektriskietikli8497 3 ปีที่แล้ว

    Thanks. This vba code is awesome. I add it as a module to my working file with a small modification, but i still can’t modify it to skip text (just text info, not hyperlink) at B4:B100 and load to C4:C100 text when in B cell is text and picture when in B cell is hyperlink.

  • @roronoa_d_law1075
    @roronoa_d_law1075 ปีที่แล้ว

    ActiveSheet.Pictures.Insert(pic) doesn't work for images stored on aws S3 😥
    error 1004

  • @joethecockerspaniel5576
    @joethecockerspaniel5576 8 หลายเดือนก่อน

    Is there a way to do the same in MS Word?

  • @satishbethina123
    @satishbethina123 3 ปีที่แล้ว +1

    You can increase font size from tools options

  • @JesperBryde-Nielsen
    @JesperBryde-Nielsen 11 หลายเดือนก่อน

    It seems that there is some kind of security isse that was not in place when this was made. the 1004 errror that occures has sometthing to do with whether the link is open of not. i tried to open and keep the first 5 pictures open and then run script. That was the script imported the first 5 pictures but stopped after that. You only see the 1004 error if you delete the skip on error line

  • @davidtc3373
    @davidtc3373 3 ปีที่แล้ว +1

    does it work with base64 format? please

    • @DSMStrength
      @DSMStrength  3 ปีที่แล้ว

      unfortunately I do not know

  • @hungbuihuu4006
    @hungbuihuu4006 2 ปีที่แล้ว

    At first, Thank you so much for sharing a wonderful VBA, however if URL links are not available, VBA returns "Run-time error '1004': Unable to get the Insert property of the Picture class"
    Do yo have any suggestion to change VBA, in case of facing error links-> step over-> come to next row to insert photos

    • @lemouga
      @lemouga 2 ปีที่แล้ว

      Hi Thanks for this I have the same question

    • @DSMStrength
      @DSMStrength  2 ปีที่แล้ว

      I can maybe figure something out, TBH this video was a long time ago I would have to go back through the code.
      I would suggest that you clean up the data ahead of time before running the macro if possible.

  • @hche6887
    @hche6887 ปีที่แล้ว

    Used the VBA code for an Image Template, but does anyone know what code to ADD to handle error if image not found, then proceed to finding the next link?

  • @websitedownload713
    @websitedownload713 3 ปีที่แล้ว

    You can use our free screenshot API to securely render an image from any URL of your excel sheet. For example if you need a preview for many links.

  • @osamasundhu1952
    @osamasundhu1952 2 ปีที่แล้ว

    Your video really helped me. I just have one request, how can i lock the aspect ratio of the original image so that regardless of how i change the cell size (row and column), the image will only change according to its original aspect ratio. Im doing this so that the rest of the images in each cell that arent all of the same aspect ratio, would not get disproportionate when I have to change the column and row sizes. Also i want to be able to keep the image in the cell from spilling over to the next cell. thanks in advance!

    • @osamasundhu1952
      @osamasundhu1952 2 ปีที่แล้ว

      in other words i want the image inserted from the url to be scaled according to its original aspect ratio, so i think it should be locked.

  • @murattaylanyenigun
    @murattaylanyenigun 11 หลายเดือนก่อน

    Thanks, but what if an empty row is there, how the code steps for next instead of stop running

    • @murattaylanyenigun
      @murattaylanyenigun 11 หลายเดือนก่อน

      :) solved by myself, Set rng = Range("c4:c5,c7:c8") , skips the empty row of c6

  • @Jalaj999
    @Jalaj999 3 ปีที่แล้ว +1

    It shows "the picture can't be displayed." In the cell any solutions for this???

    • @DSMStrength
      @DSMStrength  3 ปีที่แล้ว

      please make sure your link is correct

    • @Jalaj999
      @Jalaj999 3 ปีที่แล้ว

      @@DSMStrength link is correct, but it don't shows the image.

  • @3pattimodapks
    @3pattimodapks 8 หลายเดือนก่อน

    How to show pictures in user form from urls

  • @ianpdavis
    @ianpdavis 3 ปีที่แล้ว +1

    Using this on powerpoint 2016 and it didnt work for me. Double checked the code all seems good - no error messages - just didnt do anything....

    • @DSMStrength
      @DSMStrength  3 ปีที่แล้ว

      This is for excel not powerpoint

    • @ianpdavis
      @ianpdavis 3 ปีที่แล้ว +1

      @@DSMStrength sorry I meant excel 2016 - was building a powerpoint pres while I watched. Seemingly cant separate the two words in my head. Any idea what might be the issue ? e.g Permissions etc ?

    • @DSMStrength
      @DSMStrength  3 ปีที่แล้ว

      @@ianpdavis make sure that all of your references are correct... that the code is pointing to the right cells from where to get the links.

  • @vinodsaran1537
    @vinodsaran1537 3 ปีที่แล้ว +1

    It flags the following error for me:
    Run-time error '1004': Unable to get the Insert property of the Picture class
    What should I do?

    • @DSMStrength
      @DSMStrength  3 ปีที่แล้ว

      When you go into the vba what does the error highlight

    • @SanderGh
      @SanderGh 3 ปีที่แล้ว +2

      @@DSMStrength Set myPicture = ActiveSheet.Picutures.Insert(pic)

    • @jesuseduardobittersuarez7517
      @jesuseduardobittersuarez7517 3 ปีที่แล้ว

      @@SanderGh same here

    • @realist9995
      @realist9995 3 ปีที่แล้ว

      @@SanderGh Same smh...

    • @maikethomsen4509
      @maikethomsen4509 3 ปีที่แล้ว

      @@DSMStrength I have the same problem

  • @AmandaJones-z2p
    @AmandaJones-z2p ปีที่แล้ว

    does anyone know how to have an image appear in cell from google drive that is attached to google form?

  • @pahlevybagoes7050
    @pahlevybagoes7050 3 ปีที่แล้ว +1

    How to use local path?

    • @DSMStrength
      @DSMStrength  2 ปีที่แล้ว

      should be same way I believe

  • @lindseyoregon1771
    @lindseyoregon1771 3 ปีที่แล้ว

    I keep getting an error at .Placement = x1MoveAndSize any Idea why?

    • @DSMStrength
      @DSMStrength  2 ปีที่แล้ว

      I believe this has to do with the way your sheet is set up, re check that the urls actually have photos

    • @osamasundhu1952
      @osamasundhu1952 2 ปีที่แล้ว

      you wrote x1 instead of xl so change the 1 to l as in L

  • @aremudavid3368
    @aremudavid3368 2 ปีที่แล้ว

    I'm getting this error "Sub of Function not defined"

    • @riyashete7536
      @riyashete7536 2 ปีที่แล้ว

      Heyy getting same error please reply

  • @matiasdepalma2948
    @matiasdepalma2948 2 ปีที่แล้ว

    it gave me Microsoft Visal Basics for Applications
    400 (error), im tryng in two differents computers

    • @shakilash11
      @shakilash11 2 ปีที่แล้ว

      There is some problem with https link Just change https to http

  • @jesuseduardobittersuarez7517
    @jesuseduardobittersuarez7517 3 ปีที่แล้ว +1

    1004 error dont knmow what to do

    • @DSMStrength
      @DSMStrength  2 ปีที่แล้ว

      check your data and make sure it is correct

  • @2minuteschool929
    @2minuteschool929 3 ปีที่แล้ว +1

    👍👍

  • @muhammadjamshed2128
    @muhammadjamshed2128 2 ปีที่แล้ว +1

    Not working please again

  • @SoyPijamas
    @SoyPijamas 3 ปีที่แล้ว

    I need help,. this doesn't works

    • @DSMStrength
      @DSMStrength  3 ปีที่แล้ว +1

      I assure you it does work, if you have entered the code correctly and your links are appropriate.
      Make sure you make any necessary modifications to fit your spreadsheet

  • @muhammadjamshed2128
    @muhammadjamshed2128 2 ปีที่แล้ว

    Below code has no error but haven't show the results why?
    Sub insertimagevideo()
    Dim pic As String
    Dim mypicture As Picture
    Dim rng As Range
    Dim item As Range

    Set rng = Range("c1:c3")
    For Each item In rng
    pic = item.Offset(0, -1)
    If pic = "" Then Exit Sub
    Set mypicture = ActiveSheet.Pictures.Insert(pic)

    With mypicture
    .ShapeRange.LockAspectRatio = msoFalse
    .Width = item.Width
    .Height = item.Height
    .Top = Rows(item.Row).Top
    .Left = Columns(item.Column).Left
    .Placement = xlMoveAndSize

    End With
    Next
    End Sub

  • @Evermysticdesigns
    @Evermysticdesigns 2 ปีที่แล้ว

    My code stopped at Set myPicture = ActiveSheet.Pictures.Insert(Pic) and then nothing happened , what did i do wrong ?
    Sub InsertImageVideo()
    Dim Pic As String
    Dim myPicture As Picture
    Dim rng As Range
    Dim item As Range
    Set rng = Range("d2:d100")
    For Each item In rng
    Pic = item.Offset(0, -1)
    If Pic = "" Then Exit Sub
    Set myPicture = ActiveSheet.Pictures.Insert(Pic)

    With myPicture
    .ShapeRange.LockAspectRatio = msoFalse
    .Width = itemWidth
    .Height = itemHeight
    .Top = Rows(item.Row).Top
    .Left = Columns(item.Column).Left
    .Placement = xlMoveAndSize

    End With

    Next




    End Sub

    • @Evermysticdesigns
      @Evermysticdesigns 2 ปีที่แล้ว

      error was: Unable to get the insert property of the Picture class

    • @khajornpatrungprasitporn3972
      @khajornpatrungprasitporn3972 ปีที่แล้ว

      I get same the problem. that "Runtime error '1004'" and debug stop at the same your process.
      I already check the url of picture are ok. Please help me for this problem. and thank you for your video and your feed back.

  • @Pedroffs
    @Pedroffs 2 ปีที่แล้ว

    Hello, Great explenation!
    Could you share your code?
    I am running the below code buy getting the Runtime error 1004.
    Any help?
    Sub InsertImageVideo()
    Dim pic As String
    Dim myPicture As Picture
    Dim rng As Range
    Dim item As Range
    Set rng = Range("h3:h10")
    For Each item In rng
    pic = item.Offset(0, -1)
    If pic = "" Then Exit Sub
    Set myPicture = ActiveSheet.Pictures.Insert(pic)

    With myPicture
    .ShapeRange.LockAspectRatio = msoFalse
    .Width = item.Width
    .Height = item.Height
    .Top = Rows(item.Row).Top
    .Left = Columns(item.Column).Left
    .Placement = xlMoveAndSize

    End With

    Next



    End Sub