Old Macro

tony_d

Board Regular
Joined
Sep 27, 2003
Messages
229
We have just moved to Windows 7 Microsoft 2010 and a macro that worked on the old format has died!!!

I get an error message on line 9 With Application.FileSearch

Run time error '445'
Object doesn't support this action, at this part of the code, has this been updated by any chance?

Sub OB_new()
Dim vaFileName As Variant
Dim Sheetname As String
Dim vaWorkbook As String
Dim Thisfile As String
Dim BookToOpen As String
Const MyDir As String = "T:\Litigation & WOC Team\EXPERIAN TEAM\OneBill\1File"
'the location of the workbooks
'On Error Resume Next

With Application.FileSearch
.NewSearch
.LookIn = MyDir
'the directory to search in
.SearchSubFolders = False
.FileType = msoFileTypeAllFiles
If .Execute > 0 Then
'workbooks found
Application.ScreenUpdating = False
For Each vaFileName In .FoundFiles
'loop through each found workbook
ProcessData vaFileName
'pass workbook fullname to copy routine
Next
Else
MsgBox "There were no files found."
End If
Application.ScreenUpdating = True
End With
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes

Forum statistics

Threads
1,223,248
Messages
6,171,027
Members
452,374
Latest member
keccles

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top