Sub Insert_Me()
Dim Target,T
If ActiveCell.Column = Columns("J").Column Then
ActiveCell.RowHeight = 57: ActiveCell.ColumnWidth = 10
With Application.FileDialog(msoFileDialogFilePicker)
.InitialFileName = Getpath(&H27) & "\*.jpg"
.AllowMultiSelect = False
.Filters.Clear
.Filters.Add "Fichiers Photos", "*.jpg;*.jpeg"
.Title = "Sélection d'une photo"
If .Show Then
Target = .SelectedItems(1)
With ActiveSheet.Pictures.Insert(Target)
.Name = Target
If .Height > ActiveCell.Height Then .Height = ActiveCell.Height
If .Width > ActiveCell.Width Then .Width = ActiveCell.Width
End With
T = InputBox("Entrez le nom explicite de la photo", "Description Photo", Target)
ActiveCell.Offset(, 1) = IIf(T = "", Target, T)
End If
End With
End If
End Sub
Function Getpath(Cible As Variant) As String
Dim ObjShell As Object
On Error Resume Next
Set ObjShell = CreateObject("Shell.Application").Namespace(Cible).self
If ObjShell Is Nothing Then Getpath = vbNullString Else Getpath = ObjShell.Path
Set ObjShell = Nothing
End Function