Sub
BildEinfügenButton_Click()
With
Application.FileDialog(msoFileDialogFilePicker)
.AllowMultiSelect =
False
.ButtonName =
"Einfügen"
.Title =
"Bitte einzufügendes Bild auswählen"
.Filters.Clear
.Filters.Add
"JPG"
,
"*.JPG"
.Filters.Add
"JPEG File Interchange Format"
,
"*.JPEG"
.Filters.Add
"Graphics Interchange Format"
,
"*.GIF"
.Filters.Add
"Portable Network Graphics"
,
"*.PNG"
.Filters.Add
"Tag Image File Format"
,
"*.TIFF"
.Filters.Add
"All Pictures"
,
"*.*"
If
.Show = -1
Then
Dim
img
As
Object
Set
img = ActiveSheet.Pictures.Insert(.SelectedItems(1))
With
ActiveSheet.Range(
"C3"
)
img.Top = .Top
img.Left = .Left
If
.Width > .Height
Then
img.Height = .Height
Else
img.Width = .Width
End
If
End
With
Else
MsgBox (
"Cancelled."
)
End
If
End
With
End
Sub