我想每个月建立一个excel文件,例如e:\系统+月份.xls,我在wincc里建立了一个内部变量wMonth用于显示月份,怎样才能在名称后面加上这个变量呢?
Set oWorkBook =objExcelApp.WorkBooks.Add
oWorkBook.SaveAs "E:\系统.xls"
最佳答案
Dim wMon
wMon = Right("0"& cstr(HMIRuntime.Tags("wMonth").Read),2)
Set oWorkBook =objExcelApp.WorkBooks.Add
oWorkBook.SaveAs "E:\系统" & wMon & ".xls"
-------------------------------------------------------------------------------------
Dim wMon
wMon = Right("0"& cstr(Month(Now()),2)
Set oWorkBook =objExcelApp.WorkBooks.Add
oWorkBook.SaveAs "E:\系统" & wMon & ".xls"
提问者对于答案的评价:
非常感谢
原创文章,作者:more0621,如若转载,请注明出处:https://www.zhaoplc.com/plc271807.html