I have a Macro that has always worked on previous versions of Excel (it still works on Excel 2003 & older on different clients)
When I upgraded a user to Excel 2007 and tried to run the Macro I got the error : "Run-time error 445 - Object doesn't support this action"
I know filesearch is not supported in Excel 2007 - what can I do?
Here is the code:
With Application.FileSearch
.LookIn = Worksheets("Runtime").Range("D3").Value
.SearchSubFolders = False
.Filename = Worksheets("Runtime").Range("D5").Value & "." & Worksheets("Runtime").Range("D7").Value
.MatchTextExactly = True
.FileType = msoFileTypeAllFiles
If .Execute() > 0 Then
For i = 1 To .FoundFiles.Count
response = MsgBox("Do you want to import " & .FoundFiles(i) & "?", vbYesNoCancel, "Select Order file to import")
If response = vbYes Then ' User chose Yes.
Debug.Print "Import " & .FoundFiles(i) ' Perform some action.
vrtSelectedItem = .FoundFiles(i)
Else ' User chose No.
If response = vbNo Then
Debug.Print " Don't Import " & .FoundFiles(i) ' Perform some action.
Else
Debug.Print "Cancel selected"
End If
End If
When I upgraded a user to Excel 2007 and tried to run the Macro I got the error : "Run-time error 445 - Object doesn't support this action"
I know filesearch is not supported in Excel 2007 - what can I do?
Here is the code:
With Application.FileSearch
.LookIn = Worksheets("Runtime").Range("D3").Value
.SearchSubFolders = False
.Filename = Worksheets("Runtime").Range("D5").Value & "." & Worksheets("Runtime").Range("D7").Value
.MatchTextExactly = True
.FileType = msoFileTypeAllFiles
If .Execute() > 0 Then
For i = 1 To .FoundFiles.Count
response = MsgBox("Do you want to import " & .FoundFiles(i) & "?", vbYesNoCancel, "Select Order file to import")
If response = vbYes Then ' User chose Yes.
Debug.Print "Import " & .FoundFiles(i) ' Perform some action.
vrtSelectedItem = .FoundFiles(i)
Else ' User chose No.
If response = vbNo Then
Debug.Print " Don't Import " & .FoundFiles(i) ' Perform some action.
Else
Debug.Print "Cancel selected"
End If
End If