[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖
  1. '获取excel表sheet(1)6-10行的第三列数据到文本
  2. dim path,strexcel,counter
  3. path="E:\批处理\"
  4. set objfos=createobject("scripting.filesystemobject")
  5. set objtxt=objfos.opentextfile(path&"new.txt",2,true)
  6. set objexcel=createobject("excel.application")
  7. set objworks=objexcel.workbooks.open(path&"test.xls")
  8. set objsheets=objworks.sheets(1)
  9. for counter=6 to 10
  10.      strexcel=strexcel&vbcrlf&objsheets.cells(counter,3).value
  11. next
  12. objtxt.write strexcel
  13. objtxt.close
  14. objexcel.quit
  15. set objtxt=nothing
  16. set objfso=nothing
  17. set objsheets=nothing
  18. set objworks=nothing
  19. set objexcel=nothing
复制代码

[ 本帖最后由 batman 于 2009-4-27 18:10 编辑 ]
***共同提高***

TOP

楼主还可以参照此贴:
http://www.bathome.net/thread-4028-1-1.html
***共同提高***

TOP

返回列表