Solved

Copying snapshot from pdf filles to excel wortksheets

Posted on 2011-02-25
4
1,490 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.
We often encounter PDF files that are pure images, that is, they do not have text characters, but instead contain only raster graphics. The most common causes of this are document scanning software and faxing software/services that create image-only…

786 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