热心网友
回答时间:2024-12-31 10:17
有两个难点
1) 如果用VBA的话,没有Timer控件,如何激活?
如果用循环延时,占用过多CPU资源
2) 如果Excel关闭了自办,所以不能用VBA编
计划任务+VBS可以做到:
1) 编写VBS,用以下代码
dim WS,Fso
WScript.Sleep 300
set fso=createobject("Scripting.FileSystemObject")
fso.filecopy "C:\aa.xls","C:\" & format(date,"yyyyMMddhhmmss" & ".xls"
set fso=nothing
此文件以 Copyxls.vbs 命名
2) 设定计划任务 每隔24小时执行此文件一次
(打开控制面板 --> 计划任务 --> 添加计划任务
之后按提示操作就行)
收起
热心网友
回答时间:2024-12-31 10:13
在打开或保存事件里写:
if format(Time, "hhmm")="0900" then
thisworkbook.saveas thisworkbook.name & format(Date, "YYYYMMDDhhmmss")
end if
收起