unable to open excel document using Python through openpyxl
<p>I'm new to Python, so sorry if this is annoyingly simple. I'm trying to simply open an excel document using this,</p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override"><code>import openpyxl
from openpyxl.reader.excel import load_workbook
wb = openpyxl.load_workbook('C:\Users\ my file location here.xlsx') #with my real location</code></pre>
</div>
</div>
</p>

<p>I didn't get any error, however i don't understand why file doesn't open ?</p>

<p>The location of the file is correct as I can open it using, </p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override"><code>file = "C:\Users\ my file location here.xlsx"
# os.startfile(file)</code></pre>
</div>
</div>
</p>

<p>Thanks</p>

<p>It sounds like you want to open the file <em>in Excel</em>. That is, you want to launch the Excel application, and have the file open in that application. OpenPyXL and xlrd are not designed to do this. In fact, they are specifically designed for working with the files when you can't or don't want to launch Excel. (For example, OpenPyXL and xlrd both work on Linux machines, which can't even run Excel.)</p>

<p>You probably want some kind of Excel automation, like you would get with VBA or VBScript or a .NET language, except you want to do it in Python. If so, the package you are looking for is <strong><a href="https://www.xlwings.org/" rel="nofollow">xlwings</a></strong>.</p>

python excel