我需要从 ole db 源刷新数据,同时打开 excel 和之后保存并退出。这是我的宏代码:
Sub auto_open()
Call DataRefresh
End Sub
Sub DataRefresh()
TimeToRun = Now
Application.OnTime TimeToRun, "Refresh"
End Sub
Sub Refresh()
ActiveWorkbook.Connections("Shas").Refresh
End Sub
Sub auto_close()
Application.OnTime TimeToRun, "Refresh", , True
Application.Quit
ThisWoorkbook.Close SaveChanges:=True
End Sub
开启后更新就可以了,但是不退出。我究竟做错了什么?