Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 213
Default Insert image, get name of image

Can I insert an image and pass the file name of the image to a varaible?
Using macro recorder doesn't show anything involved with inserting an image.
--
Regards

XP Pro
Office 2007

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 213
Default Insert image, get name of image

I see that linking displays the file name in the Cell address box. Also
right clicking on the image and selecting "Size and Properties" will give
show the path and file name as one string under tab "Alt Text".
Can I access any of this information via VBE?
--
Regards

XP Pro
Office 2007



"Rick S." wrote:

Can I insert an image and pass the file name of the image to a varaible?
Using macro recorder doesn't show anything involved with inserting an image.
--
Regards

XP Pro
Office 2007

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Insert image, get name of image

The recorder will get picture if you use INSERT - Picture. The code below
lets you get a filename and then paste the picture.

filetoopen = Application _
.GetOpenFilename("Picture Files (*.jpg), *.jpg")
If filetoopen < False Then
MsgBox "Open " & filetoopen
End If

ActiveSheet.Pictures.Insert(filetoopen).Select

"Rick S." wrote:

Can I insert an image and pass the file name of the image to a varaible?
Using macro recorder doesn't show anything involved with inserting an image.
--
Regards

XP Pro
Office 2007

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 213
Default Insert image, get name of image

Perfect! Thanks Joel!
--
Regards

XP Pro
Office 2007



"Joel" wrote:

The recorder will get picture if you use INSERT - Picture. The code below
lets you get a filename and then paste the picture.

filetoopen = Application _
.GetOpenFilename("Picture Files (*.jpg), *.jpg")
If filetoopen < False Then
MsgBox "Open " & filetoopen
End If

ActiveSheet.Pictures.Insert(filetoopen).Select

"Rick S." wrote:

Can I insert an image and pass the file name of the image to a varaible?
Using macro recorder doesn't show anything involved with inserting an image.
--
Regards

XP Pro
Office 2007

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there any way to search image of my local drive with Image name or Image Title, Description [email protected] Excel Programming 3 August 3rd 07 01:44 PM
VBA to display image on a form - image is defined in Range Name Tan Excel Programming 4 May 17th 06 03:37 PM
Hyperlink to an image in other worksheet, displaying entire image. twilliams Excel Worksheet Functions 0 February 7th 06 10:02 PM
Export the worksheet background image as an image file - possible? DataFreakFromUtah Excel Programming 2 April 10th 04 04:49 PM
Open image from web in window same size as image? Milos Setek Excel Programming 0 February 5th 04 03:33 AM


All times are GMT +1. The time now is 10:10 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"