Thread: On Error
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Gary Keramidas Gary Keramidas is offline
external usenet poster
 
Posts: 2,494
Default On Error

one way, you can adapt it to you specific needs.

Sub test()
Dim quotenumber As String
quotenumber = "1234"
If Len(Dir("C:\quotes\" & quotenumber & ".xls")) 0 Then
MsgBox "open file on c drive"
Else
MsgBox "open file on server"
End If
End Sub

--


Gary Keramidas
Excel 2003


"oldjay" wrote in message
...
I want to recall a file that if not on the C drive looks on the server

quotenumber = InputBox("Please enter QUOTE file name to recall", "X
Technologies LLC")

Quote = "C:\Quotes\" & quotenumber & ".XLS"

Quote = "\\SERVER3\Jobs\Estimate1\NEW_QUOT1\" & quotenumber & ".XLS"

Workbooks.Open Filename:=Quote