作者silvaco ()
看板Visual_Basic
標題[VBA ] 請問輸出問題
時間Fri Jun 16 22:21:52 2006
Dim FileNo As Integer
Dim CurrentLine As String
Dim Filename As String
Filename = "C:\Documents and Settings\data.txt"
' Define file name
FileNo = FreeFile ' Establish free file handle
Open Filename For Output As #FileNo ' Open file (writing mode)
Print #FileNo, "This is a line of text" ' Save line
Print #FileNo, "This is another line of text" ' Save line
Close #FileNo ' Close file
請問我要如何才能讓data可以變成是一個變數呢??
我想用now()函數把每天的檔案存進去~
請問可行嗎??該怎麼做呢??
請大家指導一下~~謝謝
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 220.135.251.190
1F:推 dingyuchi:"C:\Documents and Settings\" & Now() & ".txt" 06/17 08:07
2F:→ dingyuchi:Now() 出來的東西你還要改一下 因為有些符號不能當檔名 06/17 08:08
3F:推 fumizuki:Format(Now, "yyyymmdd") 06/17 19:00