Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 52
Default Inset a picture

Is there any way (using code) to insert a picture to a worksheet? I have
tried recording the process but have not been succesful.

I want to insert graphic C:\pictures\Test.gif into cell C3.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Inset a picture


One way is:

Range("C3").Select

ActiveSheet.OLEObjects.Add(Filename:="C:\Users\xxx \Documents\xxx.jpg", _
Link:=False, DisplayAsIcon:=False).Select


--
Simon Lloyd

Regards,
Simon Lloyd
'www.thecodecage.com' (http://www.thecodecage.com)
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.thecodecage.com/forumz/member.php?userid=1
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=29833

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 70
Default Inset a picture

Is there any way (using code) to insert a picture to a worksheet? I
have tried recording the process but have not been succesful.
I want to insert graphic C:\pictures\Test.gif into cell C3.



This one is actually pretty cool:

http://www.EXCELGAARD.dk/Lib/PictureCell/


CE


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Inset a picture

Option Explicit
Sub testme01()

Dim myPict As Picture
Dim myPictName As String

myPictName = "C:\test.jpg"

With ActiveSheet
With .Range("c3")
Set myPict = .Parent.Pictures.Insert(Filename:=myPictName)
myPict.Top = .Top
myPict.Left = .Left
myPict.Width = .Width
myPict.Height = .Height
myPict.Name = "Pict_" & .Cells(1).Address(0, 0)
End With
End With
End Sub

I'm not sure if you want to fix the .width or the .height, though.

ordnance1 wrote:

Is there any way (using code) to insert a picture to a worksheet? I have
tried recording the process but have not been succesful.

I want to insert graphic C:\pictures\Test.gif into cell C3.


--

Dave Peterson
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
Can't rename or inset a tab JohnnyMac Excel Discussion (Misc queries) 5 November 6th 08 11:11 PM
how to inset a picture in a cell and make it stay in that cell Louis111 Excel Discussion (Misc queries) 4 March 5th 08 09:15 PM
Cell Inset? davewill New Users to Excel 8 August 23rd 05 07:35 PM
inset vba module using vba michael.beckinsale[_2_] Excel Programming 7 July 28th 05 09:26 AM


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

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

About Us

"It's about Microsoft Excel"