<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Working with Excel 2013, python in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/working-with-excel-2013-python/m-p/154632#M11961</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I also use the COM method to interact with Excel... Works great assuming you have Excel and PythonWin installed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It's nice to couple the data access cursors (a tuple of the field values) with a sheet's .Range() write method - fastest way I have found to write native Excel tables.... row by row instead of cell by cell.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 30 Jul 2013 23:54:40 GMT</pubDate>
    <dc:creator>ChrisSnyder</dc:creator>
    <dc:date>2013-07-30T23:54:40Z</dc:date>
    <item>
      <title>Working with Excel 2013, python</title>
      <link>https://community.esri.com/t5/python-questions/working-with-excel-2013-python/m-p/154619#M11948</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm interested in trying some data manipulation and retrieval from Excel spreadsheets.&amp;nbsp; I've been trying out the xlrd, xlwt, and xlutils packages from &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://www.python-excel.org/" rel="nofollow" target="_blank"&gt;http://www.python-excel.org/&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp; with some success, but it seems I can't make these packages work with .xlsx files, unless I go to Excel and save them as Excel 97-03 formats, .xls.&amp;nbsp; Are there updates to these packages for Excel 2013?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jul 2013 17:09:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/working-with-excel-2013-python/m-p/154619#M11948</guid>
      <dc:creator>PaulHuffman</dc:creator>
      <dc:date>2013-07-18T17:09:10Z</dc:date>
    </item>
    <item>
      <title>Re: Working with Excel 2013, python</title>
      <link>https://community.esri.com/t5/python-questions/working-with-excel-2013-python/m-p/154620#M11949</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;What version of python are you using? 2.7 should be able to open xlsx files fine.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Edit: xlrd 0.8.0+ support xlsx.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you are asking about writing to xlsx you'd need to find another module currently. openpyxl seems preferred.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jul 2013 18:11:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/working-with-excel-2013-python/m-p/154620#M11949</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2013-07-18T18:11:54Z</dc:date>
    </item>
    <item>
      <title>Re: Working with Excel 2013, python</title>
      <link>https://community.esri.com/t5/python-questions/working-with-excel-2013-python/m-p/154621#M11950</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm using Python 2.7.2.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When I try the simple example on page 10 with an xlsx file in the same folder as the script, I get a lot of red returned:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;from xlrd import open_workbook,XL_CELL_TEXT
book = open_workbook('simple.xlsx')
sheet = book.sheet_by_index(1)
cell = sheet.cell(0,0)
print cell
print cell.value
print cell.ctype==XL_CELL_TEXT
for i in range(sheet.ncols):
&amp;nbsp;&amp;nbsp;&amp;nbsp; print sheet.cell_type(1,i),sheet.cell_value(1,i)&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Traceback (most recent call last):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "C:\Users\Paul\Documents\pyscripts\Office\cell_access.py", line 2, in &amp;lt;module&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; book = open_workbook('simple.xlsx')&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "C:\Python27\ArcGIS10.1\lib\site-packages\xlrd\__init__.py", line 429, in open_workbook&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; biff_version = bk.getbof(XL_WORKBOOK_GLOBALS)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "C:\Python27\ArcGIS10.1\lib\site-packages\xlrd\__init__.py", line 1545, in getbof&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; bof_error('Expected BOF record; found %r' % self.mem[savpos:savpos+8])&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "C:\Python27\ArcGIS10.1\lib\site-packages\xlrd\__init__.py", line 1539, in bof_error&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; raise XLRDError('Unsupported format, or corrupt file: ' + msg)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;XLRDError: Unsupported format, or corrupt file: Expected BOF record; found 'PK\x03\x04\x14\x00\x06\x00'&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I try the script on an xls file, I get a lot less red.&amp;nbsp; But I thought this worked for we on xls files last week. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Traceback (most recent call last):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "C:\Users\Paul\Documents\pyscripts\Office\cell_access.py", line 4, in &amp;lt;module&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cell = sheet.cell(0,0)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "C:\Python27\ArcGIS10.1\lib\site-packages\xlrd\sheet.py", line 255, in cell&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; self._cell_types[rowx][colx],&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;IndexError: list index out of range&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 08:14:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/working-with-excel-2013-python/m-p/154621#M11950</guid>
      <dc:creator>PaulHuffman</dc:creator>
      <dc:date>2021-12-11T08:14:39Z</dc:date>
    </item>
    <item>
      <title>Re: Working with Excel 2013, python</title>
      <link>https://community.esri.com/t5/python-questions/working-with-excel-2013-python/m-p/154622#M11951</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;A possible answer for the error you are getting on SO.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://stackoverflow.com/questions/16504975/error-unsupported-format-or-corrupt-file-expected-bof-record"&gt;http://stackoverflow.com/questions/16504975/error-unsupported-format-or-corrupt-file-expected-bof-record&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Double check your xlrd version and test on a simple xlsx file.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jul 2013 21:25:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/working-with-excel-2013-python/m-p/154622#M11951</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2013-07-23T21:25:29Z</dc:date>
    </item>
    <item>
      <title>Re: Working with Excel 2013, python</title>
      <link>https://community.esri.com/t5/python-questions/working-with-excel-2013-python/m-p/154623#M11952</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;When I tried the simple file opening routine on page 7 it seemed d to work with xls files: &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;from mmap import mmap,ACCESS_READ
from xlrd import open_workbook
print open_workbook('simple.xls')
with open('simple.xls','rb') as f:
&amp;nbsp;&amp;nbsp;&amp;nbsp; print open_workbook(
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; file_contents=mmap(f.fileno(),0,access=ACCESS_READ)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )
aString = open('simple.xls','rb').read()
print open_workbook(file_contents=aString)&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;xlrd.Book object at 0x02950390&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;xlrd.Book object at 0x029211D0&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;xlrd.Book object at 0x029C19B0&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But seemed to blow up when I tried a xlsx file:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Traceback (most recent call last):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "C:\Users\Paul\Documents\pyscripts\Office\open.py", line 3, in &amp;lt;module&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print open_workbook('simple.xlsx')&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "C:\Python27\ArcGIS10.1\lib\site-packages\xlrd\__init__.py", line 429, in open_workbook&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; biff_version = bk.getbof(XL_WORKBOOK_GLOBALS)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "C:\Python27\ArcGIS10.1\lib\site-packages\xlrd\__init__.py", line 1545, in getbof&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; bof_error('Expected BOF record; found %r' % self.mem[savpos:savpos+8])&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "C:\Python27\ArcGIS10.1\lib\site-packages\xlrd\__init__.py", line 1539, in bof_error&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; raise XLRDError('Unsupported format, or corrupt file: ' + msg)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;XLRDError: Unsupported format, or corrupt file: Expected BOF record; found 'PK\x03\x04\x14\x00\x06\x00'&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 08:14:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/working-with-excel-2013-python/m-p/154623#M11952</guid>
      <dc:creator>PaulHuffman</dc:creator>
      <dc:date>2021-12-11T08:14:42Z</dc:date>
    </item>
    <item>
      <title>Re: Working with Excel 2013, python</title>
      <link>https://community.esri.com/t5/python-questions/working-with-excel-2013-python/m-p/154624#M11953</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;BR /&gt;&lt;BR /&gt;Double check your xlrd version and test on a simple xlsx file.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm using xlrd 0.9.2.&amp;nbsp; Is there revision beyond that?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jul 2013 22:29:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/working-with-excel-2013-python/m-p/154624#M11953</guid>
      <dc:creator>PaulHuffman</dc:creator>
      <dc:date>2013-07-23T22:29:04Z</dc:date>
    </item>
    <item>
      <title>Re: Working with Excel 2013, python</title>
      <link>https://community.esri.com/t5/python-questions/working-with-excel-2013-python/m-p/154625#M11954</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;There's another simple example at &lt;/SPAN&gt;&lt;A href="http://codingtutorials.co.uk/python-excel-xlrd-xlwt/"&gt;http://codingtutorials.co.uk/python-excel-xlrd-xlwt/&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp; If I run it on xls files the print.sheet_value doesn't seem to print anything. Wait, yes it works, I just happened to hit an empty cell.&amp;nbsp; But when I try to read a xlsx file, it really blows up.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;There's a example on this site to create a workbook, and that runs, creates a xls file with a bunch of numbers in it.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jul 2013 22:47:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/working-with-excel-2013-python/m-p/154625#M11954</guid>
      <dc:creator>PaulHuffman</dc:creator>
      <dc:date>2013-07-23T22:47:52Z</dc:date>
    </item>
    <item>
      <title>Re: Working with Excel 2013, python</title>
      <link>https://community.esri.com/t5/python-questions/working-with-excel-2013-python/m-p/154626#M11955</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;People at SO say that xlrd currently works with the .xlsx extension, &lt;/SPAN&gt;&lt;A href="http://stackoverflow.com/questions/4371163/reading-xlsx-files-using-python"&gt;http://stackoverflow.com/questions/4371163/reading-xlsx-files-using-python&lt;/A&gt;&lt;SPAN&gt; but that may not include the Excel 2013 files.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But there is openpyxl &lt;/SPAN&gt;&lt;A href="https://bitbucket.org/ericgazoni/openpyxl/"&gt;https://bitbucket.org/ericgazoni/openpyxl/&lt;/A&gt;&lt;SPAN&gt; that I will try tomorrow.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jul 2013 23:28:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/working-with-excel-2013-python/m-p/154626#M11955</guid>
      <dc:creator>PaulHuffman</dc:creator>
      <dc:date>2013-07-23T23:28:44Z</dc:date>
    </item>
    <item>
      <title>Re: Working with Excel 2013, python</title>
      <link>https://community.esri.com/t5/python-questions/working-with-excel-2013-python/m-p/154627#M11956</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It doesn't look promising. The openpyxl webpage &lt;/SPAN&gt;&lt;A href="http://openpyxl.readthedocs.org/en/latest/#getting-the-source" rel="nofollow noopener noreferrer" target="_blank"&gt;http://openpyxl.readthedocs.org/en/latest/#getting-the-source&lt;/A&gt;&lt;SPAN&gt; mentions only Excel 2007 xlsx files.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Plus I'm having difficulty installing openpyxl in Windows and Python 2.7.&amp;nbsp; With cmd python setup.py install, I got "No Module named setuptools" (see attached image) [ATTACH=CONFIG]26177[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then I tried to install setuptools 0.9.7 &lt;/SPAN&gt;&lt;A href="https://pypi.python.org/pypi/setuptools/0.9.7#windows" rel="nofollow noopener noreferrer" target="_blank"&gt;https://pypi.python.org/pypi/setuptools/0.9.7#windows&lt;/A&gt;&lt;SPAN&gt; but on running ez_setup.py I got another error: &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Downloading https://pypi.python.org/packages/source/s/setuptools/setuptools-0.9.7.tar.gz
Extracting in c:\users\paul\appdata\local\temp\tmptm3fqf
Now working in c:\users\paul\appdata\local\temp\tmptm3fqf\setuptools-0.9.7
Installing Setuptools
Something went wrong during the installation.
See the error message above.

Traceback (most recent call last):
&amp;nbsp; File "C:\Users\Paul\Documents\pyscripts\ez_setup.py", line 264, in &amp;lt;module&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; sys.exit(main())
SystemExit: 2&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 08:14:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/working-with-excel-2013-python/m-p/154627#M11956</guid>
      <dc:creator>PaulHuffman</dc:creator>
      <dc:date>2021-12-11T08:14:44Z</dc:date>
    </item>
    <item>
      <title>Re: Working with Excel 2013, python</title>
      <link>https://community.esri.com/t5/python-questions/working-with-excel-2013-python/m-p/154628#M11957</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Today I thought I'd try adding an environmental variable %PYTHON_PATH% and append it to %PATH%, but I got the same messages from both of the steps above.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Jul 2013 17:36:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/working-with-excel-2013-python/m-p/154628#M11957</guid>
      <dc:creator>PaulHuffman</dc:creator>
      <dc:date>2013-07-25T17:36:14Z</dc:date>
    </item>
    <item>
      <title>Re: Working with Excel 2013, python</title>
      <link>https://community.esri.com/t5/python-questions/working-with-excel-2013-python/m-p/154629#M11958</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I don't know why ez_setup.py would install setuptools-0.9.7 for me, but I downloaded setuptools.-0.9.8.tar.gz from &lt;/SPAN&gt;&lt;A href="https://pypi.python.org/packages/source/s/setuptools"&gt;https://pypi.python.org/packages/source/s/setuptools&lt;/A&gt;&lt;SPAN&gt;, unpacked it myself, opened cmd and changed directory to the unpacked folder, ran "python setup.py install" and everything installed without a problem.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then I used cmd, changed directory to the unpacked openpyxl folder, ran "python setup.py install" and it looked like openpyxl installed without problems.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now back to testing openpyxl on Excel 2013 files.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Jul 2013 20:13:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/working-with-excel-2013-python/m-p/154629#M11958</guid>
      <dc:creator>PaulHuffman</dc:creator>
      <dc:date>2013-07-26T20:13:19Z</dc:date>
    </item>
    <item>
      <title>Re: Working with Excel 2013, python</title>
      <link>https://community.esri.com/t5/python-questions/working-with-excel-2013-python/m-p/154630#M11959</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I got openpyxl to work with Excel 2013 files.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;from openpyxl import load_workbook
wb = load_workbook(filename = r'Excel2013.xlsx')
sheet_ranges = wb.get_sheet_by_name(name = 'Sheet1')
print sheet_ranges.cell('C3').value # C3&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;returns, prints the value in cell C3.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, I can't get openpyxl to work with Excel 2003 xls files.&amp;nbsp; wb = load_workbook(filename = r'Excel2003.xls') blows up.&amp;nbsp; I thought openpyxl was supposed to work with both. No it says right there at the top of the library web page "A Python library to read/write Excel 2007 xlsx/xlsm "&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm still waiting for a upgrade from Microsoft that fixes more problems than it causes.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here's a Google group that supports openpyxl for those of you that are interested in trying it: &lt;/SPAN&gt;&lt;A href="http://https://groups.google.com/forum/#!forum/openpyxl-users" rel="nofollow noopener noreferrer" target="_blank"&gt;http://https://groups.google.com/forum/#!forum/openpyxl-users&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 08:14:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/working-with-excel-2013-python/m-p/154630#M11959</guid>
      <dc:creator>PaulHuffman</dc:creator>
      <dc:date>2021-12-11T08:14:47Z</dc:date>
    </item>
    <item>
      <title>Re: Working with Excel 2013, python</title>
      <link>https://community.esri.com/t5/python-questions/working-with-excel-2013-python/m-p/154631#M11960</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It's not a quick-and-easy solution to your problem, but if you've installed &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://sourceforge.net/projects/pywin32/" rel="nofollow" target="_blank"&gt;pywin32&lt;/A&gt;&lt;SPAN&gt; and some version of Excel, you just use the COM interface to Excel.&lt;/SPAN&gt;&lt;UL&gt;&lt;BR /&gt;&lt;LI&gt;Open PythonWin&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;Click "Tools" and select "COM Makepy utility"&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;Look for something like "Microsoft Excel 12.0 Object Library" and click "OK"&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;&lt;/LI&gt;&lt;BR /&gt;&lt;/UL&gt;&lt;SPAN&gt;Now you can access Excel directly through a Python script like so:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;import win32com.client xl = win32com.client.Dispatch('Excel.Application') xl.Visible = 1 wb = xl.Workbooks.Add()&amp;nbsp; datasheet = wb.Worksheets.Add() datasheet.Name = 'New name for my worksheet' datasheet.Cells(1, 1).Value = 'This is cell A1' datasheet.Cells(2, 2).Value = 'This is cell B2'&amp;nbsp; wb.SaveAs('C:\\Temp\\example.xlsx') wb.Close(SaveChanges=1) xl.Quit() del xl&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;SPAN&gt;The documentation for accessing Excel this way is scattered, but I've scripted the processing and creating of hundreds of spreadsheets and Excel charts this way.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jul 2013 19:36:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/working-with-excel-2013-python/m-p/154631#M11960</guid>
      <dc:creator>PhilMorefield</dc:creator>
      <dc:date>2013-07-30T19:36:52Z</dc:date>
    </item>
    <item>
      <title>Re: Working with Excel 2013, python</title>
      <link>https://community.esri.com/t5/python-questions/working-with-excel-2013-python/m-p/154632#M11961</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I also use the COM method to interact with Excel... Works great assuming you have Excel and PythonWin installed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It's nice to couple the data access cursors (a tuple of the field values) with a sheet's .Range() write method - fastest way I have found to write native Excel tables.... row by row instead of cell by cell.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jul 2013 23:54:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/working-with-excel-2013-python/m-p/154632#M11961</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2013-07-30T23:54:40Z</dc:date>
    </item>
    <item>
      <title>Re: Working with Excel 2013, python</title>
      <link>https://community.esri.com/t5/python-questions/working-with-excel-2013-python/m-p/154633#M11962</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hey, great. After I installed pywin32, win32com was available to IDLE as well.&amp;nbsp; I was able to read a value from a Excel 2013 file with a simple test script: &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;# Test to see if ws32com can read a Excel 2013 spreadsheet
# testcomread.py
# import the Dispatch library, get a reference to an Excel instance
from win32com.client import Dispatch
import os
xlApp = Dispatch("Excel.Application")
# Set the Excel file name, working directory and path

old_file_name = 'Excel2013.xlsx'

working_dir = r"C:\Users\Paul\My Documents\pyscripts\Office" + os.sep

old_file_path = os.path.join(working_dir, old_file_name)

xlBook = xlApp.Workbooks.Open(old_file_path)
 
# make Excel visible (1 is True, 0 is False)
xlApp.Visible=1

# get a reference to the first sheet
xlSheet = xlBook.Sheets(1)

# extract the value from a cell
a_value = xlSheet.Cells(1,1).Value

print a_value&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Why couldn't I have found win32com when I started? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can win32com run in a Linux install of Python?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 08:14:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/working-with-excel-2013-python/m-p/154633#M11962</guid>
      <dc:creator>PaulHuffman</dc:creator>
      <dc:date>2021-12-11T08:14:51Z</dc:date>
    </item>
    <item>
      <title>Re: Working with Excel 2013, python</title>
      <link>https://community.esri.com/t5/python-questions/working-with-excel-2013-python/m-p/154634#M11963</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Here's a post with some useful examples: &lt;/SPAN&gt;&lt;A href="http://mail.python.org/pipermail/python-win32/2011-August/011738.html"&gt;http://mail.python.org/pipermail/python-win32/2011-August/011738.html&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Aug 2013 15:27:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/working-with-excel-2013-python/m-p/154634#M11963</guid>
      <dc:creator>PaulHuffman</dc:creator>
      <dc:date>2013-08-01T15:27:07Z</dc:date>
    </item>
    <item>
      <title>Re: Working with Excel 2013, python</title>
      <link>https://community.esri.com/t5/python-questions/working-with-excel-2013-python/m-p/154635#M11964</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I know this post was done forever ago but it has been helpful to me.&amp;nbsp; However, I now need to be able to delete the first column in the spreadsheet but I haven't been able to find code for that.&amp;nbsp; Can you point me in the right direction?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Nov 2017 22:31:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/working-with-excel-2013-python/m-p/154635#M11964</guid>
      <dc:creator>LyleShakespear</dc:creator>
      <dc:date>2017-11-29T22:31:38Z</dc:date>
    </item>
    <item>
      <title>Re: Working with Excel 2013, python</title>
      <link>https://community.esri.com/t5/python-questions/working-with-excel-2013-python/m-p/154636#M11965</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The easiest way I have done it personally is to use the readline() method, split that line into a list, return the new one by indexing out the first column and then joining and writing the line out to a new file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;try&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;SPAN&gt;with&lt;/SPAN&gt;&lt;SPAN&gt; open&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;fin&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;SPAN&gt;'r'&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;SPAN&gt;as&lt;/SPAN&gt;&lt;SPAN&gt; inf&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;with&lt;/SPAN&gt;&lt;SPAN&gt; open&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;fout&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;SPAN&gt;'w'&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;SPAN&gt;as&lt;/SPAN&gt;&lt;SPAN&gt; outf&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for&lt;SPAN&gt; line &lt;/SPAN&gt;&lt;SPAN&gt;in&lt;/SPAN&gt;&lt;SPAN&gt; inf&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;lineToCheck &lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt; line &amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;#variable the for loop to hold the line from fin&lt;/SPAN&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&amp;nbsp;correctedLine = body(lineToCheck)&amp;nbsp; # corrected line String&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;outf&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;write&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;correctedLine&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...and the function to deal with it...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;def&lt;/SPAN&gt;&lt;SPAN&gt; body&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;lineCheck&lt;/SPAN&gt;&lt;SPAN&gt;&lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/SPAN&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;'''Parses through&amp;nbsp;the lines of the csv removing&amp;nbsp;the first&amp;nbsp;column.'''&lt;/SPAN&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;tempLine &lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt; lineCheck&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;split&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;','&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;SPAN&gt;# creates a list from the parsed input line&lt;/SPAN&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;tempLine &lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt; tempLine&lt;/SPAN&gt;&lt;SPAN&gt;[1:&lt;/SPAN&gt;&lt;SPAN&gt;]&lt;/SPAN&gt;&lt;SPAN&gt; # drops the "0" position in the list and returns the rest&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;returnString &lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;SPAN&gt;','&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;join&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;tempLine&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;SPAN&gt; # rejoins the line&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;return&lt;/SPAN&gt;&lt;SPAN&gt; returnString # returns it back to main script&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Dec 2017 21:34:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/working-with-excel-2013-python/m-p/154636#M11965</guid>
      <dc:creator>JasonWhite</dc:creator>
      <dc:date>2017-12-04T21:34:07Z</dc:date>
    </item>
    <item>
      <title>Re: Working with Excel 2013, python</title>
      <link>https://community.esri.com/t5/python-questions/working-with-excel-2013-python/m-p/154637#M11966</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Jason.&amp;nbsp; I'll give this a try.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Dec 2017 16:02:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/working-with-excel-2013-python/m-p/154637#M11966</guid>
      <dc:creator>LyleShakespear</dc:creator>
      <dc:date>2017-12-06T16:02:55Z</dc:date>
    </item>
  </channel>
</rss>

