Hi all,
I located a code that allows the user to browse image files & then paste that image to the "active" spreadsheet, my problem is I need the file path to go to a specific sheet ("Sheet1") & cell ("A1") within the workbook & to a specific size, is it possible to adapt the code below to suit? Another anticipated problem is if the user want to paste a second image (maximum 2 allowed) to the same sheet in ("A2"). As always guys any advise / guidance will be greatly appreciated, thank you all & have a great day - Marco
Sub Rectangle1_Click()
Dim fileToOpen As Variant
fileToOpen = Application _
.GetOpenFilename("All Picture Files (*.jpg;*.gif;*.bmp;*.tif),*.jpg;*.gif;*.bmp;*.tif")
If fileToOpen <> False Then
txtFile = fileToOpen
Module1.insert_pic (fileToOpen)
ActiveSheet.Shapes("newPic").Left = 0
Unload Me
End If
End Sub
Option Explicit
Sub insert_pic(sFilePath As String)
Dim s As String
s = sFilePath
ActiveSheet.Pictures.Insert(s).Name = "newPic"
End Sub
Bookmarks