Abhijeet R. Joshi
Active Member
Hi all,
I am trying to convert a pdf file to excel without any installation of software since my company policy does not allow to install any external software.
Problem one: could open the pdf and copy to excel, but only copies the first page and not the rest.
Problem two: to bypass problem one, I understood I can use chrome to copy complete data and then copy from there and paste in excel but having problems in building that code.
Please see the below VBA till now:
Any help or directions in the correct path would help..TIA
I am trying to convert a pdf file to excel without any installation of software since my company policy does not allow to install any external software.
Problem one: could open the pdf and copy to excel, but only copies the first page and not the rest.
Problem two: to bypass problem one, I understood I can use chrome to copy complete data and then copy from there and paste in excel but having problems in building that code.
Please see the below VBA till now:
Code:
Sub StartAdobe()
'Dim AdobeApp As String
'Dim AdobeFile As String
'Dim StartAdobe
'
'AdobeApp = "C:\Program Files\Adobe\Reader 9.0\Reader\AcroRd32.exe"
'AdobeFile = "C:\Users\ABHI'S\Desktop\A.pdf"
'
'StartAdobe = Shell("" & AdobeApp & " " & AdobeFile & "", 1)
Dim chromePath As String
chromePath = """C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"""
Shell (chromePath & """ -url C:\Users\ABHI'S\Desktop\A.pdf""")
Application.OnTime Now + TimeValue("00:00:05"), "FirstStep"
End Sub
Private Sub FirstStep()
SendKeys ("^a")
SendKeys ("^c")
Application.OnTime Now + TimeValue("00:00:05"), "SecondStep"
End Sub
Private Sub SecondStep()
'SendKeys ("^w")
'Application.ActivateMicrosoftApp xlMicrosoftProject
'Application.ActivateMicrosoftApp Excel.exe
Shell "C:\Users\ABHI'S\Desktop\pdf to excel convertor.xlsb", 1
'ThisWorkbook.Worksheets("Sheet1").Activate
'Set xl = CreateObject("Excel.Sheet")
'xl.Application.Workbooks.Open "pdf to excel convertor.xlsb"
'Application.Windows("pdf to excel convertor.xlsb").Activate
Range("A1").Activate
SendKeys ("^v")
End Sub
Any help or directions in the correct path would help..TIA