Re : image d'une feuille excel sur l'userform
Bonjour BOCARAMEL,
voici ce que j'utilise pour copier un epage excel sur une image d'un userform, à adapté si cela peux t'interesser:
Dim FicTmp As String,
Application.DisplayAlerts = False
On Error Resume Next
Workbooks("ton fichier".xls").Activate
If Err <> 0 Then
On Error GoTo 0
Dim fso As Object, x As Boolean
Set fso = CreateObject("Scripting.FileSystemObject")
x = fso.FileExists(chemin + ton fichier ".xls")
If x = False Then
MsgBox "Le dossier est absent de la base de données", vbCritical, "Avertissement"
Exit Sub
Else
If x = True Then
Workbooks.Open (chemin + ton fichier ".xls")
End If
End If
End If
FicTmp = Space(160)
GetTempFileNameA Environ("TMP"), "", 0, FicTmp
FicTmp = Left$(FicTmp, InStr(FicTmp, vbNullChar) - 1)
Worksheets("ta feuille").Range("A1😛73").CopyPicture
OpenClipboard 0
DeleteEnhMetaFile CopyEnhMetaFileA(GetClipboardData(14), FicTmp)
CloseClipboard
With "ton userform"
.Image1.Picture = LoadPicture(FicTmp)
Kill FicTmp
End With
en rouge ce que tu dois adapté, une solution de plus, en espérant avoir répondu a tes attentes
@+