View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Ryan H Ryan H is offline
external usenet poster
 
Posts: 489
Default Dir function error

I'm going to go out on a limp. This code isn't tested, but try:

Dim fName As String
Dim DestPath As String

DestPath = ThisWorkbook.Path & "\"
fName = Dir(DestPath & "*.*")
Do Until fName = ""

'additional logic here

fName = Dir("")
Loop

Hope this helps! If so, let me know, click "YES" below.
--
Cheers,
Ryan


"BigJimmer" wrote:

I have the following code...

Dim fName As String
dim DestPath as string

DestPath = ThisWorkbook.Path & "\"
fName = Dir(DestPath & "*.*")
Do Until fName = vbNullString

'additional logic here

fName = Dir
Loop

I get error 5 Invalid procedure call or argument on the line fname = Dir and
don't understand why.

I am using Excel 2000.

Thanks!