i tried it this way now
and still replace all the image
what are we missing??
LoadingImages .Column(5, intindex), intindex + 1
Sub LoadingImages(m_url As String, m_index As Integer)
Dim imageurl As String
Dim fileName As String
imageurl = m_url
fileName = Environ("temp") & "" & Mid(imageurl, InStrRev(imageurl, "/") + 1)
' size of thumbnail
Dim lngSide As Long
lngSide = 50
Dim ws As Worksheet
Set ws = ThisWorkbook.Sheets.Add
Dim cht As Chart
Set cht = ws.Shapes.AddChart(xlColumnClustered, _
Width:=lngSide, _
Height:=lngSide).Chart
Application.DisplayAlerts = False
ws.Delete
Application.DisplayAlerts = True
For i = 1 To 1
For j = 1 To m_index
k = i + (1 * j)
Set cmdLots(k) = Frame2.Controls.Add("Forms.Image.1", "cmd" & m_index)
With cmdLots(k)
.Top = i * 6
.Left = (j * 50) - 55 + 12
.Height = 54
.Width = 48
.BackColor = RGB(50, 50, 0)
.PictureSizeMode = fmPictureSizeModeZoom
.Picture = Nothing
End With
Next j
Next i
For Each ctrl In Frame2.Controls
' MsgBox (ctrl.name) 'i used this and seems it show cmd1 cmd1 cmd1 cmd 2 cmd 2 cmd2 cmd3 cmd3 cmd3
'so i guess that's way it replace them....
'but how to fix it please
If TypeName(ctrl) = "Image" Then
If ctrl.name = "cmd1" Then
ctrl.Picture = LoadPicture(fileName)
Exit Sub
End If
End If
Next ctrl
End If
End Sub
Bookmarks