Images Excel 2010 to 2007

gnlampe

New Member
Joined
Oct 31, 2012
Messages
6
Hello guys,

I developed a project to search for images and insert then in the activecell. For the Excel 2010 it worked just fine, but for 2007 all the images go to the same place. Anyone can help me out?

Sub Imagem()

ActiveSheet.Unprotect Password:="Exemplo"

Dim Pict
Dim Imagem As Object
Dim ImgFileFormat As String

ImgFileFormat = "Image Files JPG (*.jpg),*.jpg, Image Files PNG (*.png),*.png , Image Files GIF (*.gif),*.gif , Image Files BMP(*.bmp),*.bmp"


Pict = Application.GetOpenFilename(ImgFileFormat)
If Pict = False Then End

Set Imagem = ActiveSheet.Pictures.Insert(Pict)

Imagem.Top = Imagem.TopLeftCell.Top
Imagem.Left = Imagem.TopLeftCell.Left
Imagem.ShapeRange.LockAspectRatio = msoTrue
Imagem.ShapeRange.Height = 76.5354330709
Imagem.ShapeRange.IncrementTop 30.6963779528

ActiveSheet.Protect DrawingObjects:=False, Contents:=True, Scenarios:= _
True, AllowFormattingCells:=True, AllowFormattingColumns:=True, _
AllowFormattingRows:=True, AllowInsertingColumns:=True, AllowInsertingRows _
:=True, AllowDeletingColumns:=True, AllowDeletingRows:=True, AllowSorting _
:=True, AllowFiltering:=True, AllowUsingPivotTables:=True, Password:="Exemplo"

End Sub
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest

Forum statistics

Threads
1,214,789
Messages
6,121,593
Members
449,038
Latest member
Arbind kumar

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top