How to Solve NameError: name 'Dispatch' is not defined -- win32com
Solution: Import the 'Dispatch' module
To Solve the error, add the following line to the top of your code.
from win32com.client import Dispatch
For more information:
Python win32com Dispatch