PDA

View Full Version : opening/extracting ole object file in excel via excel VBA



naris
12-16-2008, 08:09 PM
Hi,

I want opening or extracting ole object file in excel via excel VBA , would you help me give the macro script to run it ?

Thanks,
:think: Naris

Kenneth Hobs
12-16-2008, 08:27 PM
To open an embedded ole object in Excel, doubleclick it. Otherwise, you will need to explain what the OLE object is and what you expect to do with the contents in Excel. An attached xls usually helps us help you better.

naris
12-16-2008, 11:53 PM
Dear Kenneth Hobs,

I want extracted or opened the ole object contained pdf file in my excel file without double clicking the ole object, but via excel macro (please see the file enclosed ), I hope you can help me for this.
Thanks you for response.

Regards,
Naris

Benzadeus
12-17-2008, 03:38 AM
Just set the macro to the OLE object instead the shape.

Kenneth Hobs
12-17-2008, 06:47 AM
Does your recorded macro not do what you wanted? It can be simplified by:
Sub Macro1()
ActiveSheet.Shapes("Object 3").Select
Selection.Verb Verb:=xlPrimary
End Sub


Or the one liner:
ActiveSheet.OLEObjects("Object 3").Verb xlPrimary

naris
12-18-2008, 05:13 PM
thanks

naris