March 20, 2003 at 7:51 am
I actually like your code Phil. It is simple to the point of being elegant.
Tim C.
//Will write code for food
Tim C //Will code for food
March 20, 2003 at 6:25 pm
Ok then, so for the best of both worlds, how about,
OPTION EXPLICIT
'********************************************
' Visual Basic ActiveX Script
'********************************************
Function Main()
< ... snip ... >
sFileName = sPath & ReturnMonth(sNow) & "_" & ReturnDay(sNow) & ".xls"
' Use this for testing :-)
' Msgbox(sFileName)
' Rename the file
f1.Name = sFileName
Set f1 = Nothing
Set fso = Nothing
' Exit the task with success
Main = DTSTaskExecResult_Success
End Function
' *** Helper Function to format Month nicely ***
Function ReturnMonth(dtDate)
ReturnMonth = Right("00" & Month(dtDate), 2)
End Function
' *** Helper Function to format Day nicely ***
Function ReturnDay(dtDate)
ReturnDay = Right("00" & Day(dtDate), 2)
End Function
Hope this helps
Phill Carter
--------------------
Colt 45 - the original point and click interface
Edited by - phillcart on 03/20/2003 6:25:49 PM
Edited by - phillcart on 03/20/2003 6:27:21 PM
--------------------
Colt 45 - the original point and click interface
Viewing 2 posts - 16 through 16 (of 16 total)
You must be logged in to reply to this topic. Login to reply