View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Gregg[_4_] Gregg[_4_] is offline
external usenet poster
 
Posts: 17
Default How to capture file name in a folder?

Thanks, Roy. I went back and read about the DIR function. Nice.

Roy Harrill wrote:
Try this --

Sub GetPPT()

Dim f as string
f = Dir("C:\whatever\*.ppt")

End Sub


"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.