Solved

Copying snapshot from pdf filles to excel wortksheets

Posted on 2011-02-25
4
1,452 Views
Last Modified: 2012-05-11
Dear all,

Recently I have come up an idea to automize the process for copying snapshots (with the camera icon) in pdf pages to different excel worksheets (e.g. Copy selected area in Page 1 of pdf to Sheet  1 of Excel file and then Copy selected area in Page 2 of pdf to Sheet  2 of Excel file.... and so on). However, the trial vba code sticks to an error 91 in "gApp = CreateObject("AcroExch.App")" before I can trial the subsequent code.

Can anyone advise how to fix this problem and how to write the line for copying for acrobat and pasting to excel. The office documents e.g. Developing Application Using Interapplication Communication from Adobe did not help at all.

I am testing on a machine with the specification :-
1. Acrobat 9.0 Pro
2. Office 2007 with Adobe Acrobat 9.0 Type Library  in vba environment
3. WinXP Pro


Regards,


Kenneth  


Option Explicit

Dim gApp As Acrobat.CAcroApp
Dim gPDDoc As Acrobat.CAcroPDDoc
Dim jso As Object


Private Sub CommandButton1_Click()

gApp = CreateObject("AcroExch.App")<-- Error sticks here
gPDDoc = CreateObject("AcroExch.PDDoc")

If gPDDoc.Open("D:\Rate book.pdf") Then



End If
End Sub

Open in new window

image-record.pdf
image-record.xls
error91.jpg
0
Comment
Question by:Lawlords
  • 2
  • 2
4 Comments
 
LVL 22

Accepted Solution

by:
rspahitz earned 500 total points
ID: 34982894
VBA requires that you use the word "Set" when assigning to object-type variables.  Try this:


Set gApp = CreateObject("AcroExch.App")'<-- Error sticks here
0
 

Author Comment

by:Lawlords
ID: 34990025
The error issue solved thanks.
0
 

Author Closing Comment

by:Lawlords
ID: 34990030
Thanks a lot, I can start to study the copy and paste method now.
0
 
LVL 22

Expert Comment

by:rspahitz
ID: 34990112
Just curious if it was a "B" because it wasn't good enough or because it was just too simple?
Either way, glad it got you going.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Inserting page numbers in Portable Document Files not only enhances manageability but also makes them look professional. With numbered pages, the file appears more organized and it becomes easier to search for a particular page. The size and the vol…
Using Word 2013, I was experiencing some incredible lag when typing.  Here's what worked for me....
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
Sometimes we receive PDF files that are in the wrong orientation. They may be sideways or even upside down. This most commonly happens with scanned or faxed documents. It is possible to rotate the view of these PDFs with the free Adobe Reader produc…

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now