0

I want to open an excel file in Microsoft excel, and I don't want to do it using a mouse click but rather a python code. How can I do it?

Kundan
  • 613
  • 10
  • 19
  • Does this answer your question? [How to open external programs in Python](https://stackoverflow.com/questions/37238645/how-to-open-external-programs-in-python) – Tomerikoo Sep 13 '20 at 14:17

1 Answers1

1

You can use os.startfile

import os, subprocess
os.startfile(r'filepath') #For windows only
subprocess.call(['open', 'filepath']) #For MAC only
venky__
  • 5,552
  • 3
  • 17
  • 28