



The code will include two pieces, as has been shown in this example. Now, we can start to develop the macro “responsible” for extracting needed data from every. 5 Our essential data is in a PDF document, which must be transferred to Google Sheets.Ĥ. You must stick to the cells defined in the code if you want to have your code working properly (Pic. It has been already defined in the code above in the emboldened section. In your current worksheet, you have to define the target directory both for the source file and for the converted file as well. Nwb.SaveAs (excel_path & "\" & Replace(f.Name, ".pdf", ".xlsx")) Set doc = wa.Documents.Open(f.Path, False, Format:="PDF Files") Set wa = CreateObject("word.application") Set setting_sh = ThisWorkbook.Sheets("Your_Sheet_Name")Įxcel_path = setting_sh.Range("C5").Value xlsm, where you will go straight to the “ Developer” panel and create the new VBA module in which you should write the following code: Sub PDF_To_Excel() 1 Our PDF documents are in the directory.Ģ.
