请帮帮忙,本人第一次写这种东西。看看我这个写的对不对(肯定不对,都运行不了),应该怎么写,谢谢! private sub commandbutton2_click()
写入文本文件 end sub
sub 写入文本文件() fd = application.getopenfilename(filefilter:=" 文本文件(*.txt),*.txt", title:="请选择写入文件") open fd for output as fn i = 1 do if cells(i, 1).text = "" then exit do print #fn, cells(i, 1).text i = i + 1 loop close #fn end sub
发表于:2007-11-26 13:25:071楼 得分:5
写入文本文件() 过程名不能使用中文 open fd for output as fn 这里是fd
close #fn 这里怎么是fn了 ??
发表于:2007-11-26 14:06:162楼 得分:0
写入文本文件() 过程名不能使用中文 open fd for output as fn 这里是fd
close #fn 这里怎么是fn了 ?? =========================================================== 过程名可以使用中文 fd是文件名,fn是文件号。
发表于:2007-11-26 14:06:593楼 得分:95
vbscript code
fd = application.getopenfilename(filefilter:=" 文本文件(*.txt),*.txt", title:="请选择写入文件")
fn = freefile()
open fd for output as fn
i =1doif cells(i, 1).text =""thenexitdo
print #fn, cells(i, 1).text
i = i +1loop
close #fn