View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.programming
Stuart[_3_] Stuart[_3_] is offline
external usenet poster
 
Posts: 50
Default Make excel check external file paths

Is there a better way to have excel check external file paths exist?

The methods given are returning #NAME? each time I enter a correct file
path in cell A1,

Please respond as soon as you can,

Kind Regards,

Stuart


NickHK wrote:
Stuart,
Don't know if it applicable to you, but you can also call windows API
directly from the worksheet. This has the advantage of dealing only in
Unicode. For me this is good because my English XL/Window is on a network
where the other computers run Chinese Windows 2K and NT4. Dir() and
GetAttr() cannot handle this.

<Module code
Declare Function GetFileAttributes Lib "kernel32" Alias "GetFileAttributesW"
(ByVal lpFileName As String) As Long
</Module code

Then the cell formula is just:
==IF(GetFileAttributes(A15)0,TRUE,FALSE)

NickHK

"Stuart" wrote in message
oups.com...
I have a spreadsheet which contains thousands of file paths going doing
column A. I wanted excel to be able to look at cell A1, A2 and so on
and check if the file does exist on the harddrive and then return in
cell B1 return Yes or No.

I wanted this to loop until it reaches the end of the file paths and
has returned yes or no for all of them.

Thanks in advance.

Stuart