Hi.
So, i got a code for checking if a file exists from google.
The problem is with it, even tho the file actually exists, it keep skipping it, as it didn't exists.
Code:
Sub CFF()
Dim fso: Set fso = CreateObject("Scripting.FileSystemObject")
If fso.FileExists("Desktop\SkjKa.xlsm") Then
' do what you like in the case where the file exists
UserForm3.Show
Else
' do whatever you wanted to do where the file doesn't exist
Welcome.Show
End If
End Sub
If the file dont exist, it runs the welcome.show.
However, if the file exists in desktop, it still runs welcome.show, and not userform 3.
Does anyone know whats wrong here?
Thanks
So, i got a code for checking if a file exists from google.
The problem is with it, even tho the file actually exists, it keep skipping it, as it didn't exists.
Code:
Sub CFF()
Dim fso: Set fso = CreateObject("Scripting.FileSystemObject")
If fso.FileExists("Desktop\SkjKa.xlsm") Then
' do what you like in the case where the file exists
UserForm3.Show
Else
' do whatever you wanted to do where the file doesn't exist
Welcome.Show
End If
End Sub
If the file dont exist, it runs the welcome.show.
However, if the file exists in desktop, it still runs welcome.show, and not userform 3.
Does anyone know whats wrong here?
Thanks