behzad.nouri
behzad.nouri

Reputation: 77961

how to make vba-word work in vba-excel?

the following two lines

Dim curTasks As Tasks
Set curTasks = Application.Tasks

get the list of all current tasks and work like charm in vba-word but not in vba-excel. is there a way to port it into vba-excel?

Upvotes: 0

Views: 1562

Answers (1)

EkoostikMartin
EkoostikMartin

Reputation: 6911

As I said in comments, the Excel object in VBA doesn't have the concept of tasks. You can do the below though in an Excel Module (although I'm still not sure why you would do it):

Dim curTasks As Tasks

Dim wrd As Word.Application

Set wrd = CreateObject("Word.Application")

Set curTasks = wrd.Tasks

NOTE: you have to add a reference to Microsoft Word Object Library to get this to work

Upvotes: 2

Related Questions