Image (Active X Control) functionality not fully implemented in Excel

Copper Contributor

Building a form that requires excel functionality, but also requires the ability to have the Image (Active X Control) working as it does in Word.  Currently in excel the Image box does not have the "picture" header when inserted into the form and therefore does not have give the user the ability to click the box to then select an image to upload to the box.  

Have been told this is with developers to complete for excel so would like to know if there is an eta for this and also if there is any known work arounds in the meantime.

1 Reply

@sherrymr 

Here are a few options you can explore in the meantime:

  1. Use a different control: Excel offers other controls, such as the "Picture" control, which allows users to insert and view images directly within a worksheet. You can add the "Picture" control to your form and configure it to allow image selection.
  2. Use a command button and VBA code: Instead of relying on the Image control, you can use a command button in combination with VBA code to prompt the user to select an image file and display it in a designated area of the form.
  3. Custom UserForm: You can create a custom UserForm using VBA and design it to have the desired image functionality. With a custom UserForm, you have more flexibility in designing and implementing specific features, including the ability to upload images.

Here is an example of VBA code that demonstrates how to create a custom UserForm in Excel with the ability to upload and display images:

Private Sub CommandButton1_Click()
    Dim filePath As String
    Dim img As Picture
    
    'Open a file dialog to select an image file
    With Application.FileDialog(msoFileDialogFilePicker)
        .Title = "Select an Image File"
        .Filters.Add "Images", "*.jpg;*.jpeg;*.png;*.gif;*.bmp"
        .FilterIndex = 1
        
        If .Show = -1 Then
            filePath = .SelectedItems(1)
        End If
    End With
    
    'Load the selected image into the Image control on the UserForm
    If filePath <> "" Then
        Set img = LoadPicture(filePath)
        Me.Image1.Picture = img
    End If
End Sub
  1. Open the Visual Basic for Applications (VBA) editor by pressing Alt+F11 in Excel.
  2. Insert a new UserForm by clicking on "Insert" in the menu and selecting "UserForm".
  3. Design your UserForm by adding controls such as a CommandButton and an Image control. You can also add other controls as needed for your specific form.
  4. Double-click on the CommandButton to open the code window for the button's Click event.
  5. In the code window, enter the following VBA code:
  6. vba code
  7. Close the code window and return to the UserForm design view.
  8. Test your UserForm by running it. You can do this by pressing F5 or by going to the "Run" menu and selecting "Run Sub/UserForm".
  9. This code adds a CommandButton to the UserForm. When the button is clicked, it opens a file dialog where the user can select an image file. The selected image is then loaded into the Image control on the UserForm.
  10. You can customize this code further based on your specific requirements, such as adding error handling or additional functionality.

It's worth noting that Microsoft continuously updates and enhances its software products, so it's possible that future versions of Excel may include the functionality you're looking for. To stay up to date with the latest features and updates for Excel, you can check the Microsoft Office website, official blogs, or announcements from Microsoft. Since no one has answered it for at least one day or more, I entered your question in various AI. The text and the steps are the result of various AI's put together.

 

My answers are voluntary and without guarantee!

 

Hope this will help you.