Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Python by (16.4k points)

I'm thinking about utilizing Python, yet prior to bouncing in, I need to discover a python package that can do

  1. Use python to manipulate Excel (with its add-ins) and use its functions without opening Excel?
  2. If I need to open Excel, I need to automate that task of executing the script every day, or at specific moment of the day (the market data need to feed a specific time)


Thank you in advance.

1 Answer

0 votes
by (26.4k points)

You want the Python Win32 extensions, Click on this link.

Then, You can utilize COM,

from win32com.client import Dispatch

excel = Dispatch('Excel.Application')

wb = excel.Workbooks.Open(r'c:\path\to\file.xlsx')

ws = wb.Sheets('My Sheet')

# do other stuff, just like VBA

wb.Close()

excel.Quit()

You can put your content on Windows Task Scheduler to execute for the occasions you want.

Want to become an expert in Python? Join the python course fast!

Related questions

0 votes
1 answer
asked Jul 30, 2019 in Others by Rajesh Malhotra (19.9k points)
0 votes
1 answer
0 votes
1 answer
asked Dec 10, 2020 in Python by laddulakshana (16.4k points)
0 votes
1 answer
asked Mar 21, 2021 in Python by laddulakshana (16.4k points)

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...