"Dir" uot of order

G

Guest

Hi
I run Excel 2007 but are writing code in an 2003excelfile (xls). Suddenly
does not Dir function works in folliwing sub

Sub FindData()

Dim path, filename As String


path = "D:Officebyggaren\CBRE\TEMP\"

Application.ScreenUpdating = False
filename = Dir(path)

......and so on

The path D:Officebyggaren\CBRE\TEMP\ include three files.
Dir have worked but suddenly it doesn't!!! Runing step by step I can see
"Filename ="" ".
Thank's in advance to that guy who can support me
/KentAE
 
C

Chip Pearson

Perhaps it is typo, but you are missing a '\' character after the drive
spec.

path = "D:Officebyggaren\CBRE\TEMP\"
' should be
path = "D:\Officebyggaren\CBRE\TEMP\"


--
Cordially,
Chip Pearson
Microsoft MVP - Excel, 10 Years
Pearson Software Consulting
www.cpearson.com
(email on the web site)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top