您的位置:首页 > 编程语言 > VB

VBS脚本 自动更新excel文件 并导出为csv文件

2009-01-18 13:27 453 查看
str = left(wscript.scriptfullname,instrrev(wscript.scriptfullname,"/")-1)

Set fso = CreateObject("Scripting.FileSystemObject")

If fso.FileExists(str+"/1138-data.csv") Then
fso.DeleteFile str+"/1138-data.csv", true
End If

Set fso=NoThing

strXlsFile = str+"/1138-宝银-data.xls"

Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Open(strXlsFile)

Call objExcel.ActiveWorkbook.SaveAs(str+"/1138-data.csv",6)

objWorkbook.Close
objExcel.Quit

WScript.quit

----------------------------------------------------------

这个导出类型的查阅了很多资料

Call objExcel.ActiveWorkbook.SaveAs(str+"/1138-data.csv",6)

Option Explicit
Const xlCSV = 6
Const xlCSVMac = 22
Const xlCSVMSDOS = 24
Const xlCSVWindows = 23
Const xlCurrentPlatformText = -4158
Const xlExcel9795 = 43
Const xlTextMSDOS = 21
Const xlTextPrinter = 36
Const xlTextWindows = 20
Const xlUnicodeText = 42
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: