Macro to Open embedded file

Knyte

Board Regular
Joined
Dec 17, 2008
Messages
55
Hi
I have tried searching all forums/threads to help me with this but can't seem to find a resolution.

I have a embedded PDF file in a separate worksheet.

I have untilized a button where if the user will click the button and it will open the embeded PDF file.

I have the following code:

Sub Guidelines_File()
Sheets("Sheet").Shapes("Object 1").Select
Selection.Verb Verb:=xlOpen
End Sub

Also tried:

Sub Guidelines_File()
Sheets("Sheet").Shapes("Object 1").Select
Selection.Verb Verb:=xlPrimary
End Sub

It won't work.

Please help.
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Have solved this problem. Used the following coding instead. Was hoping there was a more simpler code to use but this works so ...

Sub Guidelines_File()
Dim oEmbFile As Object
Application.DisplayAlerts = False
Set oEmbFile = ThisWorkbook.Sheets("Guidelines").OLEObjects("Object 1")
oEmbFile.Verb Verb:=xlPrimary
Set oEmbFile = Nothing
Application.DisplayAlerts = True
End Sub
 
Upvote 0

Forum statistics

Threads
1,222,095
Messages
6,163,881
Members
451,864
Latest member
Pandorom

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