Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Alonsa Miller   on Feb 01 In MS Office Category.

  
Question Answered By: Adelaide Fischer   on Feb 01

You need to add Microsoft Scripting Library to your references for this
to work.



Dim fso As FileSystemObject

Dim objFolder As Folder

Dim objFile As File

Dim strName As String



Set fso = New FileSystemObject

Set objFolder = fso.GetFolder("C:\MyDocs")



For Each objFile In objFolder.Files

strName = objFile.Path



If Right(strName, 4) = ".xls" Then

MsgBox "It's there!"

End If

Next

Share: 

 

This Question has 2 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on To find .XLS file in a folder Or get search suggestion and latest updates.


Tagged: