cherriegal
May 12th, 2005, 01:36 AM
Hi, :)
i wanted to change the directory of the of a list of arrays file..
But i am having problem when i wrote the code as shown below.. Its part of what i have wrote..
When i tried to run.. there is a compile error.("CopyFile" was highlighted) Its says " Compile error: Expected Function or variable" I am still very new to VB so does not know what is the problem.. Anyone plz help me ??
If InStr(file.Name, "24_Hours") > 0 Then
outputFiles_s(SummarySize) = Replace(inputFiles_s(SummarySize), ".txt", ".doc")
outputFiles_s(SummarySize) = Replace(outputFiles_s(SummarySize), "_MMM_", thisMonth)
outputFiles_s(SummarySize) = fso.CopyFile(C:\Sp\mmmyyyy\Source", "C:\Sp\mmmyyyy\Report\24hrs\Summary", True)
ElseIf InStr(file.Name, "Mon-Fri") > 0 Then
outputFiles_s(SummarySize) = Replace(outputFiles_s(SummarySize), ".txt", ".doc")
outputFiles_s(SummarySize) = Replace(outputFiles_s(SummarySize), "_MMM_", thisMonth)
outputFiles_s(SummarySize) = fso.CopyFile("C:\Sp\mmmyyyy\Source", "C:\Sp\mmmyyyy\Report\Mon-Sat\Summary", True)
End If
i wanted to change the directory of the of a list of arrays file..
But i am having problem when i wrote the code as shown below.. Its part of what i have wrote..
When i tried to run.. there is a compile error.("CopyFile" was highlighted) Its says " Compile error: Expected Function or variable" I am still very new to VB so does not know what is the problem.. Anyone plz help me ??
If InStr(file.Name, "24_Hours") > 0 Then
outputFiles_s(SummarySize) = Replace(inputFiles_s(SummarySize), ".txt", ".doc")
outputFiles_s(SummarySize) = Replace(outputFiles_s(SummarySize), "_MMM_", thisMonth)
outputFiles_s(SummarySize) = fso.CopyFile(C:\Sp\mmmyyyy\Source", "C:\Sp\mmmyyyy\Report\24hrs\Summary", True)
ElseIf InStr(file.Name, "Mon-Fri") > 0 Then
outputFiles_s(SummarySize) = Replace(outputFiles_s(SummarySize), ".txt", ".doc")
outputFiles_s(SummarySize) = Replace(outputFiles_s(SummarySize), "_MMM_", thisMonth)
outputFiles_s(SummarySize) = fso.CopyFile("C:\Sp\mmmyyyy\Source", "C:\Sp\mmmyyyy\Report\Mon-Sat\Summary", True)
End If