Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Copying snapshot from pdf filles to excel wortksheets

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

Office 365 Training for Admins - 7 Day Trial

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

Question has a verified solution.

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

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
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.
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…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

722 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