Code:
Set fs = CreateObject("Scripting.FileSystemObject")
If fs.FileExists(ActiveWorkbook.Path & "\" & "FileName.xls") Then
  MsgBox "File Exists!" '檔案存在
Else
  MsgBox "File Not Exists!" '檔案不存在
End If

Comment:
ActiveWorkbook.Path 目前活頁簿的路徑
FileName.xls 檔案名稱

arrow
arrow
    全站熱搜

    leftalan 發表在 痞客邦 留言(0) 人氣()