12/20/2023 0 Comments Import pdf form into excelWhat this does is essentially the same thing you are trying to do - only using Adobe's own library. StrText = strText & objSelection.GetText(tCount) Set objSelection = objPage.CreatePageHilite(objHighlight)įor tCount = 0 To objSelection.GetNumText - 1 ObjHighlight.Add 0, 10000 ' Adjust this up if it's not getting all the text on the page Set objPage = objPDDoc.AcquirePage(pageNum) Make sure to add the Library to your references too (On my machine it is the Adobe Acrobat 10.0 Type Library, but not sure if that is the newest version)Įven with the Adobe library it is not trivial (you'll need to add your own error-trapping etc): Function getTextFromPDF(ByVal strFilename As String) As Stringįor pageNum = 0 To objPDDoc.GetNumPages() - 1 You can open the PDF file and extract its contents using the Adobe library (which I believe you can download from Adobe as part of the SDK, but it comes with certain versions of Acrobat as well) 'Application.Wait Now + TimeValue("00:00:2") Set openPDF = CreateObject("Shell.Application")Īpplication.Wait Now + TimeValue("00:00:2") ![]() 'When Scan Receipts Button Pressed Scan the selected folder/s for receiptsįor Each fCell In Range(ws.Cells(1, 1), ws.Cells(1, ws.Cells(1, ws.Columns.Count).End(xlToLeft).Column)) If ws.Cells(ws.Rows.Count, "A").End(xlUp).Row > 1 Then Range("A3:A" & ws.Cells(ws.Rows.Count, "A").End(xlUp).Row).ClearContents Why is my paste not working? If I paste after the macro has stopped running it pastes as normal. ![]() I get an error when I try to paste the data from the PDF document. I am currently doing this through SendKeys and it is not working. The PDFs show and text can be manually copied and pasted into the Excel document. I am trying to extract the data from a PDF document into a worksheet.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |