<?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: SearchCursor + Excel .XLSX Files in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/searchcursor-excel-xlsx-files/m-p/286197#M22130</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Jake,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is essentially what I have been doing which works perfect for an xls:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
#Open spreadsheet with info
xls = &amp;lt;spreadsheet location&amp;gt;

# Create search cursor to parse spreadsheet info
rows = arcpy.SearchCursor(xls)

for row in rows:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Set username/password for each connection as variable
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; user = row.USER
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; password = row.PASSWORD&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When I save that xls out as an xlsx and re-run I get the 99999 error.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Ben&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 13:50:01 GMT</pubDate>
    <dc:creator>BenYoungs</dc:creator>
    <dc:date>2021-12-11T13:50:01Z</dc:date>
    <item>
      <title>SearchCursor + Excel .XLSX Files</title>
      <link>https://community.esri.com/t5/python-questions/searchcursor-excel-xlsx-files/m-p/286195#M22128</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;All,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have several scripts that utilize the SearchCursor in ArcPy to pull info from .xls files, and it works very well. When I try the same approach using a Excel 2007+ .xlsx file, I get an "ERROR 999999: Error Executing Function". I read the following from the Desktop 10 Help:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;If you have an .xlsx file you want to use in ArcGIS but do not have Excel 2007 installed, you will need to install the 2007 Office System Driver. It can be downloaded here from the Microsoft Download Center. If you have Microsoft Excel 2010 or no version of Microsoft Excel installed, you must install the 2007 driver before you can use either .xls or .xlsx files.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now I realize I don't have Excel 2007 installed on my server, and I dont think I have the 2007 Office System Driver installed either. Funny thing is that I can view the .xlsx file through Catalog with no issues. So it doesnt seem like the driver is the issue.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there a known issue trying to use the SearchCursor with .xlsx files or is there a trick to this? I suppose I could go the route of pulling in another Python module to handle these files (XLRD?), but in my environment it is difficult to bring in outside software.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance for any advice you may have.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Jun 2012 20:15:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/searchcursor-excel-xlsx-files/m-p/286195#M22128</guid>
      <dc:creator>BenYoungs</dc:creator>
      <dc:date>2012-06-06T20:15:53Z</dc:date>
    </item>
    <item>
      <title>Re: SearchCursor + Excel .XLSX Files</title>
      <link>https://community.esri.com/t5/python-questions/searchcursor-excel-xlsx-files/m-p/286196#M22129</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Ben,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can you post the code you are working with?&amp;nbsp; Be sure to wrap it in the CODE tags when posting.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Jun 2012 10:57:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/searchcursor-excel-xlsx-files/m-p/286196#M22129</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2012-06-07T10:57:40Z</dc:date>
    </item>
    <item>
      <title>Re: SearchCursor + Excel .XLSX Files</title>
      <link>https://community.esri.com/t5/python-questions/searchcursor-excel-xlsx-files/m-p/286197#M22130</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Jake,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is essentially what I have been doing which works perfect for an xls:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
#Open spreadsheet with info
xls = &amp;lt;spreadsheet location&amp;gt;

# Create search cursor to parse spreadsheet info
rows = arcpy.SearchCursor(xls)

for row in rows:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Set username/password for each connection as variable
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; user = row.USER
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; password = row.PASSWORD&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When I save that xls out as an xlsx and re-run I get the 99999 error.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Ben&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 13:50:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/searchcursor-excel-xlsx-files/m-p/286197#M22130</guid>
      <dc:creator>BenYoungs</dc:creator>
      <dc:date>2021-12-11T13:50:01Z</dc:date>
    </item>
    <item>
      <title>Re: SearchCursor + Excel .XLSX Files</title>
      <link>https://community.esri.com/t5/python-questions/searchcursor-excel-xlsx-files/m-p/286198#M22131</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;hi Ben,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;did you specify the worksheet (marked with the "$" sign at the end) as well, not just the .xslx file?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;i get the 999999 error if i only point to the .xlsx files´location.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
# this works
xls = r"J:\test\excelfile.xlsx\sheet1$"

# this doesn´t
xls1 = r"J:\test\excelfile.xlsx"

&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 13:50:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/searchcursor-excel-xlsx-files/m-p/286198#M22131</guid>
      <dc:creator>RaphaelR</dc:creator>
      <dc:date>2021-12-11T13:50:03Z</dc:date>
    </item>
    <item>
      <title>Re: SearchCursor + Excel .XLSX Files</title>
      <link>https://community.esri.com/t5/python-questions/searchcursor-excel-xlsx-files/m-p/286199#M22132</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Rafael,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Sorry, I forgot to include that in my code snippet before. Yes, I have been using "\Sheet1$" at the end of the path. So essentially all I am doing is changing the .xls to .xlsx in the spreadsheet path and then I get the error thrown.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;hi Ben,&lt;BR /&gt;&lt;BR /&gt;did you specify the worksheet (marked with the "$" sign at the end) as well, not just the .xslx file?&lt;BR /&gt;i get the 999999 error if i only point to the .xlsx files´location.&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
# this works
xls = r"J:\test\excelfile.xlsx\sheet1$"

# this doesn´t
xls1 = r"J:\test\excelfile.xlsx"

&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 13:50:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/searchcursor-excel-xlsx-files/m-p/286199#M22132</guid>
      <dc:creator>BenYoungs</dc:creator>
      <dc:date>2021-12-11T13:50:06Z</dc:date>
    </item>
  </channel>
</rss>

