Run-time error 1004 opening embedded object

harveya915

Board Regular
Joined
Sep 4, 2015
Messages
141
I have an embedded object (pdf) in my sheet. I have a Command Button to open up that object. Here is the code I have:

Private Sub CommandButton4_Click()
With ActiveSheet
Set o = .OLEObjects("Object 15")
o.Verb xlVerbOpen
End With
End Sub

However, after I click the button, the pdf does open up but i get a run time error 1004: Cannot start the source application for this object. When I click Debug it highlights the line:

o.Verb xlVerbOpen

Any help on how to fix this? Much thanks!
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Follow up:
I noticed that the error doesn't immediately pop up. When the PDF file opens up, I minimize it, resize it, or move it to another screen and I don't see the error show up anywhere. Not until I close the file is when the error shows up.
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,279
Members
452,630
Latest member
OdubiYouth

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