In Excel 2003 is there any way to read pdf file names from a single directory and put them inside an Excel spreadsheet?
Asked
Active
Viewed 4,512 times
0
-
1You'll need to give a lot more details. Do you want to read these filenames out of one specific directory? – Lance Roberts Mar 31 '11 at 00:19
-
1yes 1 directory, very good point. My apologies. – EKet Mar 31 '11 at 06:38
2 Answers
1
Dim c as Range, tmp
Dim FolderPath as string
FolderPath = "C:\MyFolder\"
Set c = ActiveSheet.Range("A1")
tmp = Dir(FolderPath & "*.pdf")
Do While tmp<>""
c.value = tmp
set c = c.offset(1,0)
tmp=Dir()
Loop
Tim

Tim Williams
- 154,628
- 8
- 97
- 125
-
1+1 I guess some of us just get it the first time. Thanks a bunch I did not know it was that easy. – EKet Mar 31 '11 at 06:37
0
To list files from a folder take a look at FileSystemObject.
Provide os more info about what you need, we'll help you better.
Rgds

Community
- 1
- 1

Tiago Cardoso
- 2,057
- 1
- 14
- 33