Len(Dir(fName)) not working

Zzyzzyth

Board Regular
Joined
Feb 19, 2002
Messages
145
I've seen dozens of examples using this line of code:
If Len(Dir(fName)) > 0 then 'file exists
but I can't get it to work. Is there a certain library reference that I need to include to make it work?
 
You will need the .xls part.

Are you sure that the spaces are exactly the same, KSS 35 6, that the spaces between the characters are exactly the same as in your string, no spaces before or after exactly as in your filename?
 
Upvote 0

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
That did the trick HotPepper. Don't know if it was the 13 hour day, or just getting some sleep, but starting from scratch and using your line of code worked just fine. (with the .xls extension). Not sure when you last replied, but thanks for your help and sorry about the delay. I think you're 3 hours behind me.

Now, if I could just get Screen.MousePointer = vbHourglass to work. For some reason it won't compile. It wants me to declare vbHourglass. Not sure why, but that's probably another thread.
 
Upvote 0
Not sure where you're getting Screen. from, but if you look up MousePointer Property in the VBA help file and click on Applies To, you will see the objects you can do this with.
 
Upvote 0

Forum statistics

Threads
1,216,064
Messages
6,128,562
Members
449,458
Latest member
gillmit

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top