View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 6,953
Default Searching for a file

Look in Excel VBA help at the ChangeLink command.

--
Regards,
Tom Ogilvy


"Mark McW" wrote:

Thanks very much, appreciate the help. That works fine....... Mark.

Do you also know a way that if you have a link established to another file,
how you can change it (in a macro). Again, by using a file name that is
contained in a cell?

"AA2e72E" wrote:

I think you do have not included the API declaration in the declaration
section. Try another approach

Sub aa()
spath = ActiveWorkbook.Path
If Right(spath, 1) < "\" Then spath = spath & "\"
yourfilename = spath & Sheet6.Range("u61").Value
Select Case Len(Dir(yourfilename))
Case Is = 0
'file does not exist
Case Else
'file exists
End Select
End Sub