LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Resize the image in excel 2007

First, if you're using the same code that I posted, it didn't work. The "option
explicit" line forced the declaration of the variables--so the code wouldn't
even compile.

Second, I used the corrected code and it worked exactly the same way in xl2003
as it did in xl2007.



Akader wrote:

I am using same code which you have post , if possible try to use same code
in xl2003 and see the diff.

Regards

Abdul Kader

"Dave Peterson" wrote:

It was clear to me before.

I tested it in xl2007 and it worked fine. I'm not sure why it's not working for
you.

If you changed the code, you may want to post what you actually used.



Akader wrote:

Dear Dave
this code in excel 2003 was working great like this.
in case the cell size is :
height 156 x Width 70 then when i run the code , the picture will resize
automatic in the cell with size of 156x70,

but now in 2007 the code is not changing the size automatically of picture
same as height and width like what excel 2003 was doing,

I hope now it's clear to you.

Regards

Abdul Kader

"Dave Peterson" wrote:

I tested this in xl2007 and the code put the picture entirely in the
activecell. Isn't that what you want? The size of the cell determines the size
of the picture??????

(Same code with all the declarations.)

Option Explicit
Sub GetPhotoone()

Dim rng As Range
Dim myPictName As String
Dim myPict As Picture

Set rng = ActiveCell
myPictName = Activecell.Value

Set myPict = ActiveSheet.Pictures.Insert(Filename:=myPictName)

myPict.Top = rng.Top
myPict.Left = rng.Left
myPict.Width = rng.Width
myPict.Height = rng.Height
myPict.Name = "Pict_" & Cells(1).Address(0, 0)

End Sub



Dave Peterson


--

Dave Peterson


--

Dave Peterson


 
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
I can't select, move or resize an image in Excel?? Michael Howes Excel Discussion (Misc queries) 3 April 2nd 23 07:40 PM
Resize image using macro Gotroots Excel Worksheet Functions 1 November 12th 09 11:04 PM
Drag/resize an image on UserForm by the user avi Excel Programming 6 March 17th 07 10:24 AM
auto resize when insert large image to excel sajid Excel Worksheet Functions 4 November 21st 06 03:40 PM
resize userform image to fit on any monitor timspier[_7_] Excel Programming 1 August 5th 06 06:44 AM


All times are GMT +1. The time now is 03:41 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"