+ Reply to Thread
Results 1 to 2 of 2

Batch import images into Excel on MacOs

  1. #1
    Registered User
    Join Date
    11-22-2020
    Location
    Germany
    MS-Off Ver
    Macos 2019 - 16.43
    Posts
    6

    Batch import images into Excel on MacOs

    Hello

    I'd like to import a couple of hundred images (plus a couple of hundred mp4 movie clips) into an Excel sheet. Each image and each mp4 clip should fill one cell and the cells should have a certain size, so that both are recognisable (stamp size at least). I tried different approaches, but don't get anything to work. Could someone help me using one of those visual basic scripts?

    Thanks!

  2. #2
    Registered User
    Join Date
    11-22-2020
    Location
    Germany
    MS-Off Ver
    Macos 2019 - 16.43
    Posts
    6

    Re: Batch import images into Excel on MacOs

    I found a partial solution. This vba script does import images from a URL in collumn A to collumn b


    Sub InsertPics2()
    'Pictures saved with file
    'Set column width (ie, pic width) before running macro

    Dim r As Range, Shrink As Long
    Dim shpPic As Shape
    Application.ScreenUpdating = False
    Shrink = 0 'Provides negative offset from cell borders when > 0
    For Each r In Range("A1:A" & Cells(Rows.Count, 1).End(xlUp).Row)
    If r.Value <> "" Then
    Set shpPic = ActiveSheet.Shapes.AddPicture(FileName:=r.Value, linktofile:=msoFalse, _
    savewithdocument:=msoTrue, Left:=Cells(r.Row, 2).Left + Shrink, Top:=Cells(r.Row, 2).Top + Shrink, _
    Width:=-1, Height:=-1)
    With shpPic
    .LockAspectRatio = msoTrue
    .Width = Columns(2).Width - (2 * Shrink)
    Rows(r.Row).RowHeight = .Height + (2 * Shrink)
    End With
    End If
    Next r
    Application.ScreenUpdating = True
    End Sub


    Problem: they are not linked to the cells, hence they do not move once the table is sorted, which is what I need. Does anyone have a clue how to get that done?

+ 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. VBA to import and embed images into Excel
    By zeroLOOKUP in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-09-2017, 01:55 PM
  2. Replies: 0
    Last Post: 02-14-2015, 09:24 PM
  3. can excel write a batch file run it and import the results
    By AkaTrouble in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-10-2015, 10:05 AM
  4. Images Batch Export with renaming?
    By jayq in forum Excel General
    Replies: 0
    Last Post: 08-16-2012, 07:22 AM
  5. Replies: 0
    Last Post: 02-08-2012, 03:55 PM
  6. Batch download images from url
    By mclisa81 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-29-2010, 12:09 PM
  7. import batch file to excel
    By TxRaistlin in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-28-2005, 02:06 PM

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