J
J_J
The below code helps me to display *.jpg images in my worksheet on a
spesific locaiton with a fixed dimension after being prompth for the file
name. I need to alter my code such that
i) I can be able to display images in the *.gif, *.bmp formats as well as
*.jpg
ii) I need to have a dropdown list on my page of all the files in that
spesific directory containing the images, so that I will not need to input
the file name by typing it for each selection but only to click select from
a drop down list.
Can anyone help me alter my code? Or maybe try a new one?
Thank you in advance
J_J
'---------------------------------------
Private Sub getpicture()
Dim isim As String
Dim Resim As String
Dim InI As Integer
For InI = ActiveSheet.Shapes.Count To 2 Step -1
ActiveSheet.Shapes(InI).Delete
Next InI
isim = InputBox("Name of file")
Resim = "C:\fotolar\" & isim & ".jpg"
If Dir(Resim) = "" Then MsgBox "No Such File": End
ActiveSheet.Shapes.AddPicture(Resim, True, True, 600, 10, 100, 100).Name =
"C:\fotolar\" & isim & ".jpg"
End Sub
'-------------------------------------------
spesific locaiton with a fixed dimension after being prompth for the file
name. I need to alter my code such that
i) I can be able to display images in the *.gif, *.bmp formats as well as
*.jpg
ii) I need to have a dropdown list on my page of all the files in that
spesific directory containing the images, so that I will not need to input
the file name by typing it for each selection but only to click select from
a drop down list.
Can anyone help me alter my code? Or maybe try a new one?
Thank you in advance
J_J
'---------------------------------------
Private Sub getpicture()
Dim isim As String
Dim Resim As String
Dim InI As Integer
For InI = ActiveSheet.Shapes.Count To 2 Step -1
ActiveSheet.Shapes(InI).Delete
Next InI
isim = InputBox("Name of file")
Resim = "C:\fotolar\" & isim & ".jpg"
If Dir(Resim) = "" Then MsgBox "No Such File": End
ActiveSheet.Shapes.AddPicture(Resim, True, True, 600, 10, 100, 100).Name =
"C:\fotolar\" & isim & ".jpg"
End Sub
'-------------------------------------------