Solved

Excel Macro

Posted on 2014-10-23
6
168 Views
Last Modified: 2014-11-18
I have a column that contain the link of a photo (eg. n:\myPhoto\xxxx.jpg). Any idea how to write a macro such that it can replace the text file with a actual photo and resize it to a particular width and length, Tks
0
Comment
Question by:AXISHK
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 24

Accepted Solution

by:
Phillip Burton earned 500 total points
ID: 40401207
You use code such as:

    
    ActiveSheet.Pictures.Insert(cells(1,1)).Select
    Selection.ShapeRange.ScaleWidth 0.3, msoFalse, msoScaleFromTopLeft
    Selection.ShapeRange.ScaleHeight 0.3, msoFalse, msoScaleFromTopLeft

Open in new window

0
 
LVL 26

Expert Comment

by:ProfessorJimJam
ID: 40401212
how big the photos pixels are? the width and height?
0
 

Author Comment

by:AXISHK
ID: 40405604
787 x 787 , size 248KB.

Tks
0
 
LVL 47

Expert Comment

by:Martin Liss
ID: 40449707
I've requested that this question be deleted for the following reason:

The question has either no comments or not enough useful information to be called an "answer".
0
 
LVL 24

Expert Comment

by:Phillip Burton
ID: 40449708
I thought my answer actually answered the question.

The question and my answer are:

Question: Any idea how to write a macro such that it can replace the text file with a actual photo
Answer:      ActiveSheet.Pictures.Insert(cells(1,1)).Select

Question:  and resize it to a particular width
Answer:     Selection.ShapeRange.ScaleWidth 0.3, msoFalse, msoScaleFromTopLeft

Question: and length,
Answer:     Selection.ShapeRange.ScaleHeight 0.3, msoFalse, msoScaleFromTopLeft
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

732 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