You are on page 1of 1

Private Sub CommandButton1_Click()

Dim x As String
Dim filesysteminstancia

x = "C:\Users\Tutugus\Desktop\R1.docx"
Set filesysteminstancia = CreateObject("scripting.filesystemobject")
If Not filesysteminstancia.FileExists(x) Then
MsgBox "no existe"
Else
Call Shell("explorer.exe " & x, vbMaximizedFocus)
End If

End Sub

You might also like