|
-
May 3rd, 2005, 10:39 PM
#1
Thread Starter
New Member
Visual Basic Active X Rename Question
New to Active X and Visual Basic, trying to get a grip on the coding. Below is what I have come up with to rename a .csv file to have the date appended to the end of it. The scipt says sucessful after running but the file name isn't changing, what I am missing. Thanks in advance for any replies!
Function Main()
Dim FDate
Dim DString
Dim objFSO
Dim File_XYT
FDate = Date
DString = DatePart("yyyy",FDate) & Right("0" & _
DatePart("m",FDate), 2) & Right("0" & DatePart("d",FDate), 2)
Set objFSO = CreateObject("Scripting.FileSystemObject")
File_538 = "\\PayrollFiles\ADPData\FTM (XYT)\PRXYTEMP"
If objFSO.FileExists(File_XYT) Then
File_XYT.Name = "PRXYTEMP" & DString & ".csv"
else
Main = DTSTaskExecResult_Failure
End If
Main = DTSTaskExecResult_Success
End Function
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|