将图像添加到用户窗体的工作表(excel vba)

我有一个浏览button的用户窗体,允许用户search他们的驱动器,并select一个图片(例如一个标志):

Private Sub BrowseButton_Click() Dim strFileName As String 'use GetOpenFilename Method to select picture strFileName = Application.GetOpenFilename(filefilter:="Tiff Files(*.tif;*.tiff),*.tif;*.tiff,JPEG Files (*.jpg;*.jpeg;*.jfif;*.jpe),*.jpg;*.jpeg;*.jfif;*.jpe,Bitmap Files(*.bmp),*.bmp", FilterIndex:=2, Title:="Select a File", MultiSelect:=False) If strFileName = "False" Then MsgBox "File Not Selected!" Else 'load picture to Image control, using LoadPicture property Me.Image1.Picture = LoadPicture(strFileName) 'after any change vba has to be told to refresh the UserForm for the change to appear Me.Repaint 'label caption changes after picture is loaded Me.Label1.Caption = "Logo loaded" End If End Sub 

所选图片存储在用户窗体的图像框中。 我有一个提交button,select时,我希望得到用户从图像框中select的“图片”,并将其插入到图纸上的特定位置。 这是我迄今为止:

 Sub Image9_Click() '' Submit Button Dim sld As Worksheet Set sld = Sheets("Sliders") Dim logo As Image logo = colourForm.Image1 Call updateAllColScheme ''Ignore this colourForm.Hide End Sub 

这不起作用,因为它会抛出一个错误,有没有人知道这是可以做到的?