Hi everyone, I'm hoping youi could help me to fix (or recreate) my macro to check my sharepoint site to see if a file exists. The file name is always different so the macro has been built this way:
The problem im having is, it always sais there is not file, when there is a file posted? Ive noticed that "Distric" portion of the file name usually has 2 words, like "Northern California". So with that, the file path reads with a %20 in between the 2 words. However my built file path above does not insert that %20 into the path. Maybe thats my problem?
Thanks in advacne for any help
sd
Code:
Sub CheckIfexists()
ThisFile = Worksheets("MyStoreInfo").Range("C2")
Area = Worksheets("MyStoreInfo").Range("E8")
Region = Worksheets("MyStoreInfo").Range("F8")
District = Worksheets("MyStoreInfo").Range("C8")
M0nth = Worksheets("Dashboard").Range("O8")
Set objFSO = CreateObject("Scripting.FileSystemObject")
If objFSO.FileExists(fldr = "[URL]http://abcdefg/sites/retail/123/[/URL]" & Area & "/" & Region & "/" & District & "/" & M0nth & "Schedule" & ThisFile & ".xlsx") Then
MsgBox "File is there!"
Exit Sub
Else
MsgBox "No File!!"
End If
End Sub
The problem im having is, it always sais there is not file, when there is a file posted? Ive noticed that "Distric" portion of the file name usually has 2 words, like "Northern California". So with that, the file path reads with a %20 in between the 2 words. However my built file path above does not insert that %20 into the path. Maybe thats my problem?
Thanks in advacne for any help
sd