Solved

batch insert graphics into excel using VBA

Posted on 2013-11-12
3
416 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 48

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 48

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

762 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now