FileSearch ExcXP

  • Hi every one


    This is my first post in the forum.. I hope you can help and I can help you..


    I've a problem with a macro in VB Excel XP.. this code doesn't run correctly:


    Dim i As Integer


    With Application.FileSearch
    .LookIn = "C:\MyDocuments"
    '* represents wildcard characters
    .FileName = "Hor*.xls"
    If .Execute > 0 Then 'Workbook exists
    MsgBox "There is a Workbook."
    Else 'There is NOt a Workbook
    MsgBox "The Workbook does not exist"
    End If
    End With


    I don't know what is happening, because if I execute the same code in Excel 2000 the code can find the file, but in Excel XP the macro can't do it..

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!