I am currently using python 2.7 and trying to open an excel sheet. When using the code below:
import os
from win32com.client import Dispatch
xlApp = win32com.client.Dispatch("Excel.Application")
xlApp.Visible = True
# Open the file we want in Excel
workbook = xlApp.Workbooks.Open('example.xls')
I get this error:
ImportError: No module named win32com.client
Is there any possibility of getting the error since I am using 64-bit Windows machine? Please help me with this.
Try this command: pip install pywin32
Note: Upgrade 'pip'(using, pip install --upgrade pip) if it gives the following error: " Could not find a version that satisfies the requirement pywin32>=223 (from pypiwin32) (from versions: ) No matching distribution found for pywin32>=223 (from pypiwin32) "