Was wondering if the macro coding has changed in the 2010 version of Excel. We have a workbook with several macros in it. A few of these macros are for adding pictures to the workbook. The code in the macros works for Excel 2003 and 2007, but doesn't do as it should in 2010.
The problem we are having with 2010 is that it isn't really adding the actual picture to the workbook, but rather a link to the image. When the file is saved and sent via e-mail to others, the image is not there, but instead the following error message show where the image should:
"The linked image cannot be displayed. The file may have been moved, renamed or deleted. Verify that the link points to the correct file and location."
We need it to be able to save the picture within the file itself. Here is the code for the macro:
Anyone have any ideas how to get this to save the picture and not just save a link to it?
Enkrypted
A+
The problem we are having with 2010 is that it isn't really adding the actual picture to the workbook, but rather a link to the image. When the file is saved and sent via e-mail to others, the image is not there, but instead the following error message show where the image should:
"The linked image cannot be displayed. The file may have been moved, renamed or deleted. Verify that the link points to the correct file and location."
We need it to be able to save the picture within the file itself. Here is the code for the macro:
Code:
Sub InsertBigPicture()
Dim myPicture As String, MyObj As Object
Range("h2").Select
myPicture = Application.GetOpenFilename _
("Pictures (*.gif; *.jpg; *.bmp; *.tif),*.gif; *.jpg; *.bmp; *.tif", _
, "Select Picture to Import")
If myPicture = "False" Then Exit Sub
Set MyObj = ActiveSheet.Pictures.Insert(myPicture)
With MyObj
With .ShapeRange
.LockAspectRatio = msoTrue
.Top = Range("H2").Top
.Left = Range("H2").Left
.Height = 160
.Width = 215
End With
.Placement = xlMoveAndSize
End With
Set MyObj = Nothing
End Sub
Anyone have any ideas how to get this to save the picture and not just save a link to it?
Enkrypted
A+