Edit

Share via


Task.Close method (Word)

Closes the specified task.

Syntax

expression.Close

expression Required. A variable that represents a 'Task' object.

Example

This example activates Microsoft Excel and then closes it.

For Each myTask In Tasks 
 If InStr(myTask.Name, "Microsoft Excel") > 0 Then 
 myTask.Activate 
 myTask.Close 
 End If 
Next myTask

See also

Task Object

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.