×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Excel OLEObject insert pdf file

Excel OLEObject insert pdf file

Excel OLEObject insert pdf file

(OP)
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.

RE: Excel OLEObject insert pdf file

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
https://www.doschke.name

RE: Excel OLEObject insert pdf file

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

RE: Excel OLEObject insert pdf file

(OP)
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.

RE: Excel OLEObject insert pdf file

Glad to hear it's working, Ljupce. And, by the way, welcome to the forum.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads

RE: Excel OLEObject insert pdf file

(OP)
Thanks Mike, please check my next post.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close