Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
defined object
I am getting a Compile error: message with the following Macro which was
working before. The macro was to backup a folder "shortxls" as "shortxlsmmddyy" Sub MDshortxlsmmddyy() Dim myOldFolder As String Dim myNewFolder1 As String Dim datecode As String Dim FSO As Scripting.FileSystemObject ' The statement above kick out an error "User-defined type not defined" datecode = Format(Date, "mmddyy") Set FSO = New Scripting.FileSystemObject myOldFolder = "D:\Documents and Settings\Dan\Desktop\shortxls" myNewFolder1 = "D:\MyBackup\all shortxls\shortxls" & datecode If FSO.FolderExists(myOldFolder) Then If FSO.FolderExists(myNewFolder1) = False Then FSO.CopyFolder Source:=myOldFolder, _ Destination:=myNewFolder1 Else MsgBox "Not Copied in all shortxls!" End If End If End Sub Please Help, Thanks |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Cannor strech embedded word object | Excel Discussion (Misc queries) | |||
Object | Setting up and Configuration of Excel | |||
SET statement tutorial | Excel Discussion (Misc queries) | |||
Creating a Powerpoint object (in XP onwards) with an ActiveWindow | Excel Discussion (Misc queries) | |||
VBA: Where to find Excel Object model? | Excel Discussion (Misc queries) |