Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel OLEObject insert pdf file

Status
Not open for further replies.

Ljupce Zagorac

IS-IT--Management
Nov 28, 2018
13
US
Hi experts,
Can somebody help with VFP 9 OLEObjects adding pdf file to Excel (2007 and up)?
The following code works with doc files but not with PDF's:
afile=getfile('doc')
oExcel = CREATEOBJECT('Excel.Application')
WITH oExcel
.WorkBooks.Add
.Visible = .t.
with .Activeworkbook.ActiveSheet.OLEObjects
.Add (,afile,.f.,.f.)
endwith
endwith

Thanks in advance.

 
Works for me, simply changed the "doc" to "pdf" and that's it. You only get page1 as preview, the OleObjects always stay separate objects anyway.
What are you trying to achive overall?

Bye, Olaf.

Olaf Doschke Software Engineering
 
Works for me as well. (Unlike Olaf, I don't even see page 1 as the preview; just the name of the PDF. But double-clicking on the object launches the file in the PDF viewer as expected.)

Ljupce, what happens when you run this code? What exactly are you seeing?

Mike





__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Olaf and Mike, thanks for your input.
Your confirmation made me check my Adobe installation.
It turned out to be corrupt and after reinstalling Adobe everything works well.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top