Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
以下两行
Dim curTasks As Tasks Set curTasks = Application.Tasks
获取所有当前任务的列表并像魅力一样工作,vba-word但不是vba-excel. 有没有办法将它移植到vba-excel?
vba-word
vba-excel
正如我在评论中所说,VBA 中的 Excel 对象没有任务的概念。您可以在 Excel 模块中执行以下操作(尽管我仍然不确定您为什么要这样做):
Dim curTasks As Tasks Dim wrd As Word.Application Set wrd = CreateObject("Word.Application") Set curTasks = wrd.Tasks
注意:您必须添加对 Microsoft Word 对象库的引用才能使其正常工作