View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Cone Jim Cone is offline
external usenet poster
 
Posts: 3,290
Default How to capture file name in a folder?

Gregg,

Sub FindFile()
Dim strPath As String
Dim strFile As String
strPath = "C:\whatever\*.ppt"
strFile = Dir(strPath)
MsgBox strFile
End Sub

Jim Cone
San Francisco, USA

"Gregg" wrote in message
ups.com...
In a folder exists one .ppt file and a non .ppt file. In vba I want to
capture the name of the ppt file. Can someone tell me the best way to
do that?

For example, the path is c:\whatever and the ppt name might be
anything. I just want the name of the ppt file, not the other file.

Thanks.