Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Copying snapshot from pdf filles to excel wortksheets

Posted on 2011-02-25
4
Medium Priority
?
1,660 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 1500 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ever wonder what it's like to get hit by ransomware? "Tom" gives you all the dirty details first-hand – and conveys the hard lessons his company learned in the aftermath.
Microsoft has changed the look and feel of Azure AD and Microsoft account sign-in pages so that you will have a more unified look and feel when moving between the two interfaces.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

876 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