Function TextColorSelect(BackColor As Long) As Long

'       Copyright Abbydale Systems LLC.

'       This function will return the best contast color for the colorindex number passed to it.
'       The return value will be either black or white.

:TextColorSelect = vbBlack       ' Establish default text color

If BackColor > 48 Then :TextColorSelect = vbWhite: Exit Function
If BackColor = 47 Then :TextColorSelect = vbWhite: Exit Function
If BackColor = 41 Then :TextColorSelect = vbWhite: Exit Function
If BackColor > 28 Then
    If BackColor < 33 Then
        :TextColorSelect = vbWhite
        Exit Function
    End If
End If
If BackColor > 8 Then
    If BackColor < 17 Then
        :TextColorSelect = vbWhite
        Exit Function
    End If
End If
If BackColor = 25 Then :TextColorSelect = vbWhite: Exit Function
If BackColor = 3 Then :TextColorSelect = vbWhite: Exit Function
If BackColor = 21 Then :TextColorSelect = vbWhite: Exit Function
If BackColor = 23 Then :TextColorSelect = vbWhite: Exit Function
If BackColor = 18 Then :TextColorSelect = vbWhite: Exit Function
If BackColor = 5 Then :TextColorSelect = vbWhite: Exit Function
If BackColor = 1 Then :TextColorSelect = vbWhite: Exit Function
End Function
Public Function FileExtant(ByVal MyFileName As String) As Boolean
FileName = Dir(MyFileName)
If FileName = "" Then
    MsgBox "Required file " & MyFileName & " is not in the specified directory", vbCritical
    Application.ScreenUpdating = True
    FileExtant = False
Else
    FileExtant = True
End If
End Function