VBA读写文本文件,打开文件标识符号句柄 建议使用Freefile
- 2020-04-23 08:00:00
- zstmtony 原创
- 5801
VBA读写文本文件,一般使用下面的方法,即打开文件标识符号句柄 建议使用Freefile
i=FreeFile
Open FileName For Input As #i
Open FileName For Input As #1 中的FileName一要用全路径表示
文件标识符号句柄 建议不要使用 #1 #2
因为你可能会打开多个文件(假如)
所以最好使用
dim intFileNo as integer
intFileNo=FreeFile
FreeFile 这个函数能自动生成没有使用到的文件句柄编号
这样可避免冲突
文章分类
联系我们
联系人: | 王先生 |
---|---|
Email: | 18449932@qq.com |
QQ: | 18449932 |
微博: | officecn01 |