Solved

Excel Macro

Posted on 2014-10-23
6
165 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
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 …
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…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…

749 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