“Existe um arquivo vBA” Respostas de código

Verifique se existe o arquivo

Public Function IsFile(s)
    IsFile = CreateObject("Scripting.FileSystemObject").FileExists(s)
End Function
Excel Hero

Existência do Excel VBA de um arquivo

' Existence of a file 
If Dir("C:\myDirectory\myFile", vbDirectory) = vbNullString Then
    MsgBox "Doesn't exists"
Else
    MsgBox "Exists"
End If
VasteMonde

Existe um arquivo vBA

Sub test()

thesentence = InputBox("Type the filename with full extension", "Raw Data File")

Range("A1").Value = thesentence

If Dir(thesentence) <> "" Then
    MsgBox "File exists."
Else
    MsgBox "File doesn't exist."
End If

End Sub
Robert Dorrigan

Respostas semelhantes a “Existe um arquivo vBA”

Perguntas semelhantes a “Existe um arquivo vBA”

Mais respostas relacionadas para “Existe um arquivo vBA” em VBA

Procure respostas de código populares por idioma

Procurar outros idiomas de código