Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

very simple question

Status
Not open for further replies.

altaratz

ISP
Apr 15, 2001
73
0
0
US
For some reason, I can't figure this out.

I'm trying to create a subroutine that will create a text file everyday named by that day's date. Seems really simple - but after I create a variable that is equal to Now - I don't know how to get that into the Open Filename statement:

Dim date1 As String
date1 = Now
Open "c:\date1.txt" For Output As #1

Obviously - this now creates a file called date1.txt - not a file called 06-29-2005.txt, for instance

Please help :)

-- Ethan
 
try something along the lines of


DateVar = Now
InputFileName = "C:/" & DateVar & ".Txt"
Open InputFileName For output As #1
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top