Solved

Copying snapshot from pdf filles to excel wortksheets

Posted on 2011-02-25
4
1,547 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Embed Excel WS into PPTX 4 26
Transfer Worksheet Data to Userform & Calculate based on Sum Range 28 46
copy down array 24 36
Error 1004 Excel 2013 11 17
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
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…

751 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