.Execute replaced in Excel 2007?

  • Thread starter Thread starter Jim Jackson
  • Start date Start date
J

Jim Jackson

I have a macro which does a data backup from hard drive to disk. It works
fine on my old computer which has Excel 2003 but not on my new one with Excel
2007. I get an error implying that .execute is not a valid term.

Is there a substitute for .execute that I have not discovered yet?
 
Can you be more specific, or post some code? There are 7 '.execute's listed
in the object browser for xl2007.
 
..Execute is for commandbars object. New way for ribbon. example-

CommandBars.ExecuteMso "FileNew"


|I have a macro which does a data backup from hard drive to disk. It works
| fine on my old computer which has Excel 2003 but not on my new one with
Excel
| 2007. I get an error implying that .execute is not a valid term.
|
| Is there a substitute for .execute that I have not discovered yet?
 
Sorry about that. I should have been thinking more clearly at the time.

Actually, the first error comes with "Set fs = Application.FileSearch".

Here is a snippet of the code:

Sub DataBackUp_Initial()
Dim SourceFile, src, des
Dim fs, f, z
Dim dsk As Integer
Dim FolderName, oFolder
Dim DefPath As String
Dim oApp As Object

Set fs = Application.FileSearch
With fs
.LookIn = src
.SearchSubFolders = True
.Filename = "*.*"
DefPath = src


..Execute

' More code follows

End With

' more code
End Sub
 
Back
Top