اذهب الي المحتوي
أوفيسنا

ادراج صورة بالفورم


2saad
إذهب إلى أفضل إجابة Solved by lionheart,

الردود الموصى بها

إخواني أعضاء المنتدي الكرام بعد سلام الله عليكم ورحمة الله وبركاته

في الملف المرفق وهو للأستاذة الفاضلة ساجدة العزاوي من العراق ( بارك الله فيها وفي جميع أعضاء المنتدي الكرام )

محتاج ادراج صورة بناء علي رقم التسلسل 

الصورة موجودة بالملف ملف.rar

 

ولكم جزيل الشكر

 

رابط هذا التعليق
شارك

  • أفضل إجابة

Try this code (Add it to the userform module)

Private Sub TextBox1_Change()
    Dim arrExtensions, x, ws As Worksheet, sImagePath As String, sFile As String, i As Long
    Set ws = ThisWorkbook.Sheets(1)
    arrExtensions = Array(".jpg", ".jpeg", ".png", ".gif", ".bmp")
    x = Application.Match(Val(TextBox1.Value), ws.Columns(1), 0)
    If IsError(x) Then Me.Image1.Picture = Nothing: Exit Sub
    sFile = ws.Range("A" & x).Value
    For i = 0 To UBound(arrExtensions)
        sImagePath = ThisWorkbook.Path & "\" & sFile & arrExtensions(i)
        If Dir(sImagePath) <> "" Then
            On Error Resume Next
            Me.Image1.Picture = LoadPicture(sImagePath)
            If Err.Number <> 0 Then
                MsgBox "Error Loading The Image: " & Err.Description
                On Error GoTo 0
            Else
                Exit For
            End If
        End If
    Next i
End Sub

But you have to know the png extension is not supported by userform image control so this will raises Invalid Picture

  • Like 2
رابط هذا التعليق
شارك

2 ساعات مضت, بلانك said:

?Dear Professor, LionHeart , what is the reason for not downloading the PNG image extension

I don't know. You can send messages to Microsoft support to ask them for that point

A friend of mine shows me it is possible to insert png image but this requires codes with API Windows to change the image and make it transparent before inserting it

منذ ساعه, 2saad said:

لي سؤال بعد إذنك هل من الممكن ترحيل الصورة من الشيت الي الفورم لو مثلا الصور في العمود y

I didn't get your question. You can post a new question better as this question is different from the current one

رابط هذا التعليق
شارك

زائر
هذا الموضوع مغلق.
  • تصفح هذا الموضوع مؤخراً   0 اعضاء متواجدين الان

    • لايوجد اعضاء مسجلون يتصفحون هذه الصفحه
×
×
  • اضف...

Important Information