ActiveX Button for Inserting Picture

afenrick86

New Member
Joined
Sep 4, 2014
Messages
6
I am trying to create a button in my spreadsheet that when clicked on will prompt the user to insert an image. I have most of the sheet locked down so I just want them to be able to click on the button and then the button pop up the Insert Picture prompt displays. It doesn't need to select the picture for them, just give them the option to select their file.

I don't care where the image shows up on the sheet because they can move and resize it on the sheet to where it belongs, but I am trying to remove the step of having them click "Insert > Picture" from the ribbon. Is this possible? I'm assuming so, but just have no idea how to do it.
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Hi,

Try something like this:

Code:
Private Sub CommandButton1_Click()
    Application.CommandBars.ExecuteMso ("PictureInsertFromFile")
End Sub

Regards,
 
Upvote 0
Thank you so much, RickXL! That is exactly what I was trying to do. Thankfully it is a simple solution.
 
Upvote 0
One last thing. That works great for the command button, but how can I tell it to position to a certain cell and only be a certain size on the sheet?

I want the image to be inserted in to cell H20 and not extend more than 500 pixels to the right or 500 pixels down, but I also want to constrain the proportions of the image. Is that a macro within the button or within the sheet?
 
Upvote 0

Forum statistics

Threads
1,214,947
Messages
6,122,411
Members
449,081
Latest member
JAMES KECULAH

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top