Solved

Excel Macro

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

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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
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 demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.

690 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