Solved

batch insert graphics into excel using VBA

Posted on 2013-11-12
3
437 Views
Last Modified: 2013-11-12
Dear Experts:

I wonder whether the following is feasible using VBA

I got a product list with the following make-up

item-no    description       path                                               graphic
17-15        myproduct1        C:\test\myproduct1.tif                   graphic to be inserted
17-17        myproduct2        D:\myfolder\myproduct2.tif          graphic to be inserted
17-19        myproduct3        C:\test2\myproduct3.tif                 graphic to be inserted
etc.

The graphics are not located in just one folder but are scattered in many different folders.

I wonder somebody is able to come up with a VBA solution.

I know that this should be done using excel as a data source and doing a mailmerge using word. This works just great. I have worked with that approach dozens of times, but this time the requirement is to do this directly in Excel.

Thank you very much in advance.

Regards, Andreas
0
Comment
Question by:AndreasHermle
  • 2
3 Comments
 
LVL 49

Accepted Solution

by:
Rgonzo1971 earned 500 total points
ID: 39641297
Hi,
pls try
Sub Macro1()
'
For Each c In Range(Range("C2"), Range("C" & Rows.Count).End(xlUp))
    c.Offset(0, 1).Activate
    ActiveSheet.Pictures.Insert ( _
        c.Value2)
Next
End Sub

Open in new window

Regards
0
 

Author Comment

by:AndreasHermle
ID: 39641539
Hi Rgonzo,

The last 4, 5 questions have all been answered by. Great. Works just fine.

Thank you very much for your great and professional support.

Regards, Andreas
0
 
LVL 49

Expert Comment

by:Rgonzo1971
ID: 39641552
Since I suppose you live in Germany due to your name, living on the same time zone is an advantage for a timely response.

Regards
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Approximate matching with VLOOKUP and MATCH seems to me to be a greatly under-used technique, and one which is vital for getting good performance out of large lookups. Until recently I would always have advised using an exact match for simplicity an…
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question