青烟

小燕归园花正语,水清不问旧消息。

使用vbs调用excel中的宏

使用vbs打开excel文件,并且传递参数调用excel中的macro,自动化完成excel文件的制作。

Set oExcel = createobject("Excel.Application");
oExcel.Visible = true
set oWorkbooks = oExcel.Workbooks.Open(path+filename);
' 调用excel中的auto_make宏,传递指定文件名参数
oExcel.Run "auto_make",path+csvfilename 
oWorkbooks.Save
oWorkbooks.Close
oExcel.Quit
Set oWorkbooks = nothing
Set oExcel = nothing
posted @ 2021-08-20 19:29  今后  阅读(370)  评论(0编辑  收藏  举报