PDA

View Full Version : Open all pdf one by one from a folder using followhyperlink



Nitish
12-09-2016, 10:46 PM
Hi all

I have n no of pdf files in a folder,i want to open the files one by one through a loop for copying their data to an excel worksheet.
i tried following code,please help

Private Sub CommandButton1_Click()
Dim a As String
a = "C:\Users\nitish\Desktop\work\Res\New folder\"
b = Dir(a)
Do While b <> ""
ThisWorkbook.FollowHyperlink b


b = (Dir)
Loop


End Sub