stickboy2006
New Member
- Joined
- Nov 28, 2006
- Messages
- 16
Hi all,
i have some code that ive used for years in 2003, and now, following upgrade to excel 2007, i get a run time error 445 - object doesnt support this action.
this simply searches a location for excel files - and creates a list.
CODE@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Sub test()
Dim fs As Object
Application.ScreenUpdating = False
sourcedir = "c:\"
Set fs = Application.FileSearch
With fs
.LookIn = sourcedir
.filename = "*.xls"
If .Execute > 0 Then
For i = 1 To .FoundFiles.Count
Sheets("front").Range("a" & (Sheets("front").Range("a65536").End(xlUp).Row + 1)) = .FoundFiles(i)
Next i
Else
Application.Goto Sheets("front").Range("a1"), True
Application.ScreenUpdating = True
MsgBox "There were no files found."
Exit Sub
End If
End With
End Sub
CODE END@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Does anyone have a method for this in 2007?
I tried adding old objects in the references in VBA, but it only allows me Objects 12.
I would prefer not to have to go down the route of adding previous references to old excel versions if possible.
many thanks in advance.
Stuart
i have some code that ive used for years in 2003, and now, following upgrade to excel 2007, i get a run time error 445 - object doesnt support this action.
this simply searches a location for excel files - and creates a list.
CODE@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Sub test()
Dim fs As Object
Application.ScreenUpdating = False
sourcedir = "c:\"
Set fs = Application.FileSearch
With fs
.LookIn = sourcedir
.filename = "*.xls"
If .Execute > 0 Then
For i = 1 To .FoundFiles.Count
Sheets("front").Range("a" & (Sheets("front").Range("a65536").End(xlUp).Row + 1)) = .FoundFiles(i)
Next i
Else
Application.Goto Sheets("front").Range("a1"), True
Application.ScreenUpdating = True
MsgBox "There were no files found."
Exit Sub
End If
End With
End Sub
CODE END@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Does anyone have a method for this in 2007?
I tried adding old objects in the references in VBA, but it only allows me Objects 12.
I would prefer not to have to go down the route of adding previous references to old excel versions if possible.
many thanks in advance.
Stuart