<?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: Troubles Importing XTools Pro Tools In Python in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/troubles-importing-xtools-pro-tools-in-python/m-p/40317#M3241</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi George,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Since you are using 10.2, can you use the new &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://resources.arcgis.com/en/help/main/10.2/index.html#//001200000054000000" rel="nofollow" target="_blank"&gt;Table to Excel&lt;/A&gt;&lt;SPAN&gt; tool instead of using XTools?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 30 Jan 2014 10:09:53 GMT</pubDate>
    <dc:creator>JakeSkinner</dc:creator>
    <dc:date>2014-01-30T10:09:53Z</dc:date>
    <item>
      <title>Troubles Importing XTools Pro Tools In Python</title>
      <link>https://community.esri.com/t5/python-questions/troubles-importing-xtools-pro-tools-in-python/m-p/40316#M3240</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Okay,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have tried a few options based upon what I could find online, however I am still getting errors when I try to import and run an XTools Pro tool in python.&amp;nbsp; Everything works fine when I run it as a python script attached to a model in model builder or simply run it directly as a stand alone python script in ArcGIS Desktop.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes, it is licensed, etc.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is the code I am currently trying:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;xlsxPath = reportFolder+"earthquakeReport.xlsx" xlsxDatedReport = reportFolderDated+"earthquakeReport_{}.xlsx".format(datetime.strftime(datetime.now(),"%Y-%m-%d_%H%M")) xList = "DATE;MAGNITUDE;EPICENTER"&amp;nbsp; arcpy.ImportToolbox("C:/Program Files (x86)/DataEast/XTools Pro/Toolbox/XTools Pro.tbx")&amp;nbsp; arcpy.gp.XToolsGP_Export2Excel(eqPoliciesFC,xList,xlsxPath) # error = "pythonw.exe has stopped working"&amp;nbsp; arcpy.XToolsPro_Export2Excel(eqPoliciesFC,xList,xlsxPath) # error = &amp;lt;type 'exceptions.AttributeError'&amp;gt;: 'module' object has no attribute 'XToolsPro_Export2Excel'&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have also dragged the Export2Excel tool into a model and export it resulting in the following code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;# Import arcpy module import arcpy&amp;nbsp; # Load required toolboxes arcpy.ImportToolbox("C:/Program Files (x86)/DataEast/XTools Pro/Toolbox/XTools Pro.tbx")&amp;nbsp; # Local variables: eqPolicies = "C:\\arcgisserver\\gisData\\services\\eqMap\\data\\eqMap.gdb\\eqPolicies" excelTest_xlsx = "C:\\arcgisserver\\gisData\\services\\eqMap\\data\\excelTest.xlsx"&amp;nbsp; # Process: Export Table to MS Excel arcpy.gp.toolbox = "C:/Program Files (x86)/DataEast/XTools Pro/Toolbox/XTools Pro.tbx"; arcpy.XToolsGP_Export2Excel_eqMapAnalysis(eqPolicies, "DATE;MAGNITUDE;EPICENTER", excelTest_xlsx, "true")&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any suggestions?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Any chance this is a 32 vs 64 bit issue?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am using ArcGIS 10.2.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jan 2014 23:15:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/troubles-importing-xtools-pro-tools-in-python/m-p/40316#M3240</guid>
      <dc:creator>GeorgeHaskett</dc:creator>
      <dc:date>2014-01-29T23:15:14Z</dc:date>
    </item>
    <item>
      <title>Re: Troubles Importing XTools Pro Tools In Python</title>
      <link>https://community.esri.com/t5/python-questions/troubles-importing-xtools-pro-tools-in-python/m-p/40317#M3241</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi George,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Since you are using 10.2, can you use the new &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://resources.arcgis.com/en/help/main/10.2/index.html#//001200000054000000" rel="nofollow" target="_blank"&gt;Table to Excel&lt;/A&gt;&lt;SPAN&gt; tool instead of using XTools?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jan 2014 10:09:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/troubles-importing-xtools-pro-tools-in-python/m-p/40317#M3241</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2014-01-30T10:09:53Z</dc:date>
    </item>
    <item>
      <title>Re: Troubles Importing XTools Pro Tools In Python</title>
      <link>https://community.esri.com/t5/python-questions/troubles-importing-xtools-pro-tools-in-python/m-p/40318#M3242</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;I could, but I was hoping to only export approx. 10 out of some 20+ fields.&amp;nbsp; The esri tool seems limited, however I guess I could add a few more steps and create a copy of the data, then remove the unwanted fields, and then export the table.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It appears that one could alter the names of the fields, but can they select only a few fields to export in the new Table to Excel tool?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Unfortunately for a new tool they are seriously lacking in reference material...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I may give it a try while I am attempting to get the XTools working.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jan 2014 13:53:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/troubles-importing-xtools-pro-tools-in-python/m-p/40318#M3242</guid>
      <dc:creator>GeorgeHaskett</dc:creator>
      <dc:date>2014-01-30T13:53:14Z</dc:date>
    </item>
    <item>
      <title>Re: Troubles Importing XTools Pro Tools In Python</title>
      <link>https://community.esri.com/t5/python-questions/troubles-importing-xtools-pro-tools-in-python/m-p/40319#M3243</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You could make a &lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.2/index.html#//00170000006v000000"&gt;table view&lt;/A&gt;&lt;SPAN&gt; first, and filter the fields, similar to Example 2 in the help.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jan 2014 14:47:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/troubles-importing-xtools-pro-tools-in-python/m-p/40319#M3243</guid>
      <dc:creator>LucasDanzinger</dc:creator>
      <dc:date>2014-01-30T14:47:48Z</dc:date>
    </item>
    <item>
      <title>Re: Troubles Importing XTools Pro Tools In Python</title>
      <link>https://community.esri.com/t5/python-questions/troubles-importing-xtools-pro-tools-in-python/m-p/40320#M3244</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I get yet another error when I try this at the Desktop python prompt:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;gt;&amp;gt;&amp;gt; arcpy.XToolsGP_Export2Excel(r'D:\Users\cprice\outWorkspaceTable.dbf',"TABLE_ID", "test.xlsx")
Runtime error&amp;nbsp; Traceback (most recent call last):&amp;nbsp;&amp;nbsp; File "&amp;lt;string&amp;gt;", line 1, in &amp;lt;module&amp;gt;&amp;nbsp;&amp;nbsp; File "C:\Program Files (x86)\DataEast\XTools Pro\Toolbox\XTools Pro.tbx", line 754, in XToolsGP_Export2Excel ExecuteError: Failed to execute. Parameters are not valid. ERROR 000816: The tool is not valid. Failed to execute (XToolsGP_Export2Excel).&amp;nbsp; &lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 21:34:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/troubles-importing-xtools-pro-tools-in-python/m-p/40320#M3244</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2021-12-10T21:34:22Z</dc:date>
    </item>
    <item>
      <title>Re: Troubles Importing XTools Pro Tools In Python</title>
      <link>https://community.esri.com/t5/python-questions/troubles-importing-xtools-pro-tools-in-python/m-p/40321#M3245</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I made this tool about 6 months ago.&amp;nbsp; It works pretty nicely to export tables to excel.&amp;nbsp; There is also an option to &lt;/SPAN&gt;&lt;STRONG&gt;exclude&lt;/STRONG&gt;&lt;SPAN&gt; fields.&amp;nbsp; See attached toolbox.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is a view of the checkbox for excluding the fields:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]30998[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And here is the toolbox:&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jan 2014 20:52:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/troubles-importing-xtools-pro-tools-in-python/m-p/40321#M3245</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2014-01-30T20:52:24Z</dc:date>
    </item>
    <item>
      <title>Re: Troubles Importing XTools Pro Tools In Python</title>
      <link>https://community.esri.com/t5/python-questions/troubles-importing-xtools-pro-tools-in-python/m-p/40322#M3246</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I made this tool about 6 months ago.&amp;nbsp; It works pretty nicely to export tables to excel.&amp;nbsp; There is also an option to &lt;STRONG&gt;exclude&lt;/STRONG&gt; fields.&amp;nbsp; See attached toolbox.&lt;BR /&gt;&lt;BR /&gt;Here is a view of the checkbox for excluding the fields:&lt;BR /&gt;&lt;BR /&gt;[ATTACH=CONFIG]30998[/ATTACH]&lt;BR /&gt;&lt;BR /&gt;And here is the toolbox:&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Nice work, the script looks pretty clean.&amp;nbsp; If I were to use it I would most likely modify it to work directly via python with fixed variables.&amp;nbsp; It looks like it will be a great addition to my toolbox.&amp;nbsp; Gave it a test run, but it appears that I don't have the openpyxl files.&amp;nbsp; I'll have to download them and try it again later.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I opted to add a few more lines of code in python using some additional arcpy tools.&amp;nbsp; When I get a chance I will try to get the openpyxl up and running so I can try the tool out.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Jan 2014 16:41:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/troubles-importing-xtools-pro-tools-in-python/m-p/40322#M3246</guid>
      <dc:creator>GeorgeHaskett</dc:creator>
      <dc:date>2014-01-31T16:41:47Z</dc:date>
    </item>
    <item>
      <title>Re: Troubles Importing XTools Pro Tools In Python</title>
      <link>https://community.esri.com/t5/python-questions/troubles-importing-xtools-pro-tools-in-python/m-p/40323#M3247</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;BR /&gt; Gave it a test run, but it appears that I don't have the openpyxl files.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I attached the openpyxl files in the folder (inside the "mods" subdirectory).&amp;nbsp; I am not sure if it is for version 2.6 or 2.7.&amp;nbsp; I guess my attempt to append the mods folder to your PYTHONPATH failed.&amp;nbsp; If you copy the openpyx folder into a directory in your PYTHONPATH, you should be able to run that tool.&amp;nbsp; I would just throw it in the site-packages folder.&amp;nbsp; I'm running ArcGIS 10.0 and python 2.6 so my site packages is here:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;C:\Python26\ArcGIS10.0\Lib\site-packages&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My script doesn't handle domains like the Esri tool, but it works well for a quick and dirty export.&amp;nbsp; I also included some options to center the cells and shade every other row in a light gray.&amp;nbsp; I haven't had any problems with it yet.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Jan 2014 21:31:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/troubles-importing-xtools-pro-tools-in-python/m-p/40323#M3247</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2014-01-31T21:31:11Z</dc:date>
    </item>
  </channel>
</rss>

