vba處理大量數(shù)據(jù) VBA怎么刪除文本文件?
VBA怎么刪除文本文件?思路如下:1。選擇文件路徑。2以下方法是sub mysub()const forreading=1,forwriting=2,foreandepending=8,const t
VBA怎么刪除文本文件?
思路如下:1。選擇文件路徑。2以下方法是sub mysub()const forreading=1,forwriting=2,foreandepending=8,const tristateusedefault=-2,tristatetrue=-1,tristateflse=0,dim FSO,F(xiàn),TS set FSO=CreateObject(“腳本.FileSystemObject)Dim fullName As String fullName=“D:1.txt”fso.createtextfile文件全名集合f=fso.getfile文件(全名)設(shè)置ts=f.openastextstream(用于寫入,三態(tài)真)ts.寫入“你好”ts.關(guān)閉設(shè)置TS=nothing設(shè)置F=nothing設(shè)置FSO=nothing結(jié)束sub3可以使用kill文件名刪除整個文件。