Asignar Imagen a Formulario en tiempo de creación.
publicado
Hola a Tod@s,
Espero me puedan ayudar,... al intentar insertar una imagen a un formulario en tiempo de creación por medio de VBA, me dice que el objeto no esta disponible.
Sub CreaForm()
Dim MiNewForm As Object
Set MiNewForm = Application.VBE.ActiveVBProject.VBComponents.Add(3)
With MiNewForm
.Properties("Height") = 300
.Properties("Width") = 300
.Name = "Prueba"
.Properties("Caption") = "Prueba_LBV"
.Properties("BackColor") = RGB(0, 255, 0)
.Properties("Picture") = ActiveWorkbook.Path & "\Imagen1.jpg" ' .... AQUI ME SALTA EL ERROR?
.Properties("PictureSizeMode") = 1
End With
End Sub
Hola a Tod@s,
Espero me puedan ayudar,... al intentar insertar una imagen a un formulario en tiempo de creación por medio de VBA, me dice que el objeto no esta disponible.
Sub CreaForm() Dim MiNewForm As Object Set MiNewForm = Application.VBE.ActiveVBProject.VBComponents.Add(3) With MiNewForm .Properties("Height") = 300 .Properties("Width") = 300 .Name = "Prueba" .Properties("Caption") = "Prueba_LBV" .Properties("BackColor") = RGB(0, 255, 0) .Properties("Picture") = ActiveWorkbook.Path & "\Imagen1.jpg" ' .... AQUI ME SALTA EL ERROR? .Properties("PictureSizeMode") = 1 End With End Sub
Alguna idea?
Saludos.
Imagen a Formulario_LBV.xlsm