Solved

Excel Macro

Posted on 2014-10-23
6
159 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
6 Comments
 
LVL 24

Accepted Solution

by:
Phillip Burton earned 500 total points
Comment Utility
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 25

Expert Comment

by:ProfessorJimJam
Comment Utility
how big the photos pixels are? the width and height?
0
 

Author Comment

by:AXISHK
Comment Utility
787 x 787 , size 248KB.

Tks
0
 
LVL 45

Expert Comment

by:Martin Liss
Comment Utility
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
Comment Utility
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 Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …

728 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

10 Experts available now in Live!

Get 1:1 Help Now