Thread: [Solved] Error in VBA code
View Single Post
 
Old 11-13-2014, 08:24 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,345
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

I assume you have a function 'FileFolderExists' somewhere, since that's not a native VBA function.

Try:
Code:
Private Sub TestFileExistence()
If Dir("\\cf3.pepsico.pvt\psra\Output\BI 4\Exec Dollars - Current Period.pdf", vbNormal) <> "" Then
  If Weekday(Date) = 2 Then
    Range("A1").Value = "X"
  Else
    Range("A1").Value = "!"
  End If
Else
  Range("A1").Value = "!"
End If
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote