#Excel VBA > ändern eines Bildes in einem Event

OP #7522261
Lesenswert?

Guten Morgen =)

ich bin am verzweifeln. Wieso kann ich in einem Event

1
Public Sub Image1_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
2
    SetPicture Image1
3
End Sub
1
Private Sub SetPicture(imgObject As Image)
2

3
    MsgBox iPicCnt
4

5
  Dim sPicFile As Variant
6

7
  sPicFile = Application.GetOpenFilename _
8
    ("Pictures (*.gif; *.jpg; *.bmp; *.tif; *.jxr), *.gif; *.jpg; *.bmp; *.tif; *.jxr", _
9
    , "Bild auswählen")
10
    
11
   imgObject.Picture = LoadPicture(sPicFile)
12
   imgObject.PictureSizeMode = fmPictureSizeModeStretch
13

14
End Sub

Kein Bild aktualisieren? Außerhalb des Events funktioniert es wunderbar..

Antwort schreiben

Bitte melde dich an, um einen Beitrag zu schreiben.

oder

Mit Google-Account einloggen

Die Registrierung ist kostenlos und dauert nur eine Minute.

Jetzt registrieren