I would like to insert a .jpg image into an image control on a userform. The image should first be resized to match the size of the control. I do not see how to access the .height and .width properties as the following code throws an error. How can the image be resized to fit properly in the control?
Thanks
Thanks
Code:
' return a valid file path
Dim imageFilePath As String
imageFilePath = ReturnFilenameFromFileDialog()
' define image control size
Dim imageBoxWidth As Integer: imageBoxWidth = myimagebox.width
Dim imageBoxHeight As Integer: imageBoxHeight = myimagebox.height
' load the image into the control
myimagebox.picture = LoadPicture(imageFilePath)
' size the image to match the control
myimagebox.picture.height = 100
myimagebox.picture.width = 100