<?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: Using ArcPy.TableToExcel_conversion in Script Tool removes automatically added data in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/using-arcpy-tabletoexcel-conversion-in-script-tool/m-p/111764#M8699</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks again for your help Dan. I haven't edited/updated my code that is listed here, as none of it seems to be the issue/remedy (except obviously for the TableToExcel tool). I took out the try/except statements and just let the excel inputs run (after putting them in on the GUI) and the same situation happens. Very odd!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 02 Jul 2015 17:02:12 GMT</pubDate>
    <dc:creator>LanceWilson</dc:creator>
    <dc:date>2015-07-02T17:02:12Z</dc:date>
    <item>
      <title>Using ArcPy.TableToExcel_conversion in Script Tool removes automatically added data</title>
      <link>https://community.esri.com/t5/python-questions/using-arcpy-tabletoexcel-conversion-in-script-tool/m-p/111760#M8695</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm using `ArcGIS for Desktop 10.3.0.4322`. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a peculiar occurrence that I don't quite fully understand. I have a Python Script Tool that does a number of different things, to include using the `ArcPy Mapping Module` to add newly acquired data to the `CURRENT` .mxd for viewing. This works perfectly fine, except when running a bit of additional code (bottom of post), which optionally uses (based on user input) the `arcpy.TableToExcel_conversion` tool in order to provide the user with an Excel spreadsheet version of the feature class data they queried. When watching the script run, the new feature class, `queryLayer`, shows up in the .mxd's Table of Contents, only to immediately disappear thereafter. While investigating, the feature class still exists and is fine (as would be expected), as the `arcpy.TableToExcel_conversion` tool does not delete the source file, it merely creates a newly converted one. So it is obvious that something is happening while/after the conversion is being made (as without the conversion it works fine), but I don't understand why it would be removing the newly added feature class from the .mxd's data frame/TOC. Any help or thoughts are greatly appreciated, thank you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # import arcpy module
&amp;nbsp;&amp;nbsp;&amp;nbsp; import arcpy
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; # Ask user to select the Geodatabase workspace to use for data output
&amp;nbsp;&amp;nbsp;&amp;nbsp; userWorkspace = arcpy.GetParameterAsText(0)
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; # Set workspace environment based upon user's choice
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.env.workspace = userWorkspace
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; # Ask user to select an Oracle dB Connection
&amp;nbsp;&amp;nbsp;&amp;nbsp; oracleDB = arcpy.GetParameterAsText(1)
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; # Ask user to name the Query Layer
&amp;nbsp;&amp;nbsp;&amp;nbsp; queryLayer = arcpy.GetParameterAsText(2)
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; # Ask user if they want to overwrite previously named Query Layer
&amp;nbsp;&amp;nbsp;&amp;nbsp; overwriteQ = arcpy.GetParameterAsText(3)
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; # Ask user for an SQL Query Expression to be run against the selected Oracle dB
&amp;nbsp;&amp;nbsp;&amp;nbsp; sqlQuery = arcpy.GetParameterAsText(4)
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; # Ask user to name the output of excel file (this is optional, for those who want to do excel analysis)
&amp;nbsp;&amp;nbsp;&amp;nbsp; excelName = arcpy.GetParameterAsText(5)
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; # Ask user if they want to overwrite previously named Excel File
&amp;nbsp;&amp;nbsp;&amp;nbsp; overwriteE = arcpy.GetParameterAsText(6)
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; # Ask user to select the folder output of the excel file (optional as well, depending on if user wants an excel file)
&amp;nbsp;&amp;nbsp;&amp;nbsp; excelFolder = arcpy.GetParameterAsText(7)
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; # Create spatial reference variable to assign to queryLayer
&amp;nbsp;&amp;nbsp;&amp;nbsp; spatialRef = arcpy.SpatialReference("W:\Coordinate Systems\LRS Lambert.prj")
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; # Process: 'Make Query Layer' - Creates a Query Layer using the user's Oracle dB and SQL query expression
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.MakeQueryLayer_management(oracleDB, "Temp_Layer", sqlQuery, "UNIQUE_ID", "POINT", "1050010", spatialRef)
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; # Set overwrite output for Query Layer to user's choice
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.env.overwriteOutput = overwriteQ
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; # Process: 'Copy Features' - Copies the temporary Query Layer and stores it as a permanent feature class
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.CopyFeatures_management("Temp_Layer", queryLayer)
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; # Process: 'Delete Features' - Deletes the temporary file Temp_Layer
&amp;nbsp;&amp;nbsp;&amp;nbsp; # This allows for multiple executions of this tool within the same ArcMap session without error
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Delete_management("Temp_Layer")
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; # Process: 'Define Projection' - Defines the projection of queryLayer feature class output
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.DefineProjection_management(queryLayer, spatialRef)
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; # Process: 'Add Field' - Adds new column fields to queryLayer
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddField_management(queryLayer, "First_Time", "DATE") # The first LOGDT ping
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddField_management(queryLayer, "Last_Time", "DATE") # The last LOGDT ping
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddField_management(queryLayer, "Total_Time", "STRING") # Summation of the first to last ping in time
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddField_management(queryLayer, "Total_Pings", "INTEGER") # Total number of pings (rows)
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddField_management(queryLayer, "Possible_Pings", "INTEGER") # Total number of pings possible in given timeframe
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddField_management(queryLayer, "Time_to_Process", "DATE") # How long it took for each ping to process
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; # Calculates the total number of rows (pings) for the Total_Pings field
&amp;nbsp;&amp;nbsp;&amp;nbsp; numRows = int(arcpy.GetCount_management(queryLayer).getOutput(0))
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; # UpdateCursor that will write the value of numRows to the Total_Pings field
&amp;nbsp;&amp;nbsp;&amp;nbsp; cursor = arcpy.da.UpdateCursor(queryLayer, "Total_Pings")
&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in cursor:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row[0] = numRows
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cursor.updateRow(row)
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; # SearchCursor that will read the values of LOGDT and return the first value (earliest)
&amp;nbsp;&amp;nbsp;&amp;nbsp; try: # try to read in values based on the user's SQL query
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; firstLogdt = [row[0] for row in arcpy.da.SearchCursor(queryLayer, "LOGDT")][0]
&amp;nbsp;&amp;nbsp;&amp;nbsp; except: # exception error if the user's SQL query produces no return
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; err = "No Results Found Via SQL Query\nSCRIPT EXITED" # Error message variable
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddError(err) # Print error message
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sys.exit() # Exits the script, does not attempt to run any further
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; # UpdateCursor that will write the first (earliest) LOGDT value to the First_Time field
&amp;nbsp;&amp;nbsp;&amp;nbsp; cursor = arcpy.da.UpdateCursor(queryLayer, "First_Time")
&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in cursor:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row[0] = firstLogdt
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cursor.updateRow(row)
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; # SearchCursor that will read the values of LOGDT and return the last value (latest)
&amp;nbsp;&amp;nbsp;&amp;nbsp; lastLogdt = [row[0] for row in arcpy.da.SearchCursor(queryLayer, "LOGDT")][-1]
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; # UpdateCursor that will write the last (latest) LOGDT value to the Last_Time field
&amp;nbsp;&amp;nbsp;&amp;nbsp; cursor = arcpy.da.UpdateCursor(queryLayer, "Last_Time")
&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in cursor:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row[0] = lastLogdt
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cursor.updateRow(row)
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; # Calculates the difference between firstLogdt and lastLogdt
&amp;nbsp;&amp;nbsp;&amp;nbsp; timeDiff = lastLogdt - firstLogdt # Produces a timedelta object, not datetime
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; # Calculates the total number of seconds from timeDiff
&amp;nbsp;&amp;nbsp;&amp;nbsp; timeSecs = timeDiff.total_seconds()
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; # Creates a function that will convert timeSecs to a readable format (yy:dd:hh:mm:ss)
&amp;nbsp;&amp;nbsp;&amp;nbsp; def readTime(seconds):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; minutes, seconds = divmod(seconds, 60)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; hours, minutes = divmod(minutes, 60)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; days, hours = divmod(hours, 24)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; years, days = divmod(days, 365)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return '%02d:%02d:%02d:%02d:%02d' % (years, days, hours, minutes, seconds)
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; # UpdateCursor that will write the time difference calculation to the Total_Time field
&amp;nbsp;&amp;nbsp;&amp;nbsp; cursor = arcpy.da.UpdateCursor(queryLayer, "Total_Time")
&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in cursor:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row[0] = readTime(timeSecs)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cursor.updateRow(row)
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; # Calculates the total number of pings that would occur with optimal reception
&amp;nbsp;&amp;nbsp;&amp;nbsp; possiblePings = timeSecs / 5 # 1 ping every 5 seconds
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; # UpdateCursor that will write the total number of pings possible to the Possible_Pings field
&amp;nbsp;&amp;nbsp;&amp;nbsp; cursor = arcpy.da.UpdateCursor(queryLayer, "Possible_Pings")
&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in cursor:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row[0] = possiblePings
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cursor.updateRow(row)
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; # Using ArcPy Mapping Module to add queryLayer to current .mxd map display and zoom to it
&amp;nbsp;&amp;nbsp;&amp;nbsp; mxd = arcpy.mapping.MapDocument("CURRENT") # Set variable to currently active .mxd
&amp;nbsp;&amp;nbsp;&amp;nbsp; dataFrame = arcpy.mapping.ListDataFrames(mxd)[0] # Set variable equal to the first data frame within mxd
&amp;nbsp;&amp;nbsp;&amp;nbsp; addLayer = arcpy.mapping.Layer(queryLayer) # Set variable for queryLayer
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.mapping.AddLayer(dataFrame, addLayer) # Adds queryLayer to the map
&amp;nbsp;&amp;nbsp;&amp;nbsp; dataFrame.zoomToSelectedFeatures() # Zooms to queryLayer
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.RefreshActiveView() # Refreshes the active data frame's view
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; # Set overwrite output for Excel File to user's choice
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.env.overwriteOutput = overwriteE
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; # Change workspace environment to where the user wants the Excel file to be saved
&amp;nbsp;&amp;nbsp;&amp;nbsp; try: # Tries to change the environment workspace to the user's optional excel output folder
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.env.workspace = excelFolder
&amp;nbsp;&amp;nbsp;&amp;nbsp; except:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pass # If user did not specify excel folder input, then let pass and continue on
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; # Process: 'Table To Excel' - Converts the final queried data to an excel spreadsheet file (optional)
&amp;nbsp;&amp;nbsp;&amp;nbsp; try: # Tries to run the tool (will only work if user specified optional excel inputs)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.TableToExcel_conversion(queryLayer, excelName+'.xls')
&amp;nbsp;&amp;nbsp;&amp;nbsp; except:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pass # If user did not specify optional excel inputs, then let pass and continue on
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; # delete cursor, row variables
&amp;nbsp;&amp;nbsp;&amp;nbsp; del cursor, row&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 06:41:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-arcpy-tabletoexcel-conversion-in-script-tool/m-p/111760#M8695</guid>
      <dc:creator>LanceWilson</dc:creator>
      <dc:date>2021-12-11T06:41:46Z</dc:date>
    </item>
    <item>
      <title>Re: Using ArcPy.TableToExcel_conversion in Script Tool removes automatically added data</title>
      <link>https://community.esri.com/t5/python-questions/using-arcpy-tabletoexcel-conversion-in-script-tool/m-p/111761#M8696</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-style: inherit; color: black; background-color: inherit; font-size: 9pt !important;"&gt; arcpy.env.overwriteOutput = overwriteQ&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-style: inherit; color: black; background-color: inherit; font-size: 9pt !important;"&gt; wont work selectively, it is True or False and applies to everything.&amp;nbsp; The potential solution is to use Delete_Management in its place.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jul 2015 22:36:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-arcpy-tabletoexcel-conversion-in-script-tool/m-p/111761#M8696</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2015-07-01T22:36:18Z</dc:date>
    </item>
    <item>
      <title>Re: Using ArcPy.TableToExcel_conversion in Script Tool removes automatically added data</title>
      <link>https://community.esri.com/t5/python-questions/using-arcpy-tabletoexcel-conversion-in-script-tool/m-p/111762#M8697</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;@Dan Patterson - Thank you very much for taking a look at my code and trying to help me discern the problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately, that is not the issue and did not solve my strange occurrence. I removed both 'arcpy.env.overwriteOutput' lines and then ran the script, it still had the same issue. So then I went a step further and in the Script Tool GUI I didn't put in any of the optional excel inputs, ran the script, and still the same issue occurred, regardless of the fact that arcpy.TableToExcel_conversion didn't even run, but the code was still there. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lastly, to reconfirm what I already knew, I coded (#) out the excel parts, and lo and behold, the feature class was added to the TOC and worked just fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Besides there being some very strange bug or interaction happening with the TableToExcel tool, I have no idea what could be making this happen.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Jul 2015 14:33:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-arcpy-tabletoexcel-conversion-in-script-tool/m-p/111762#M8697</guid>
      <dc:creator>LanceWilson</dc:creator>
      <dc:date>2015-07-02T14:33:29Z</dc:date>
    </item>
    <item>
      <title>Re: Using ArcPy.TableToExcel_conversion in Script Tool removes automatically added data</title>
      <link>https://community.esri.com/t5/python-questions/using-arcpy-tabletoexcel-conversion-in-script-tool/m-p/111763#M8698</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am not sure...any problems with the try-except blocks are simply ignored by the use of the pass statement.&amp;nbsp; I didn't know whether you had modified your original code to reflect your current standing in it, so I can't really comment further.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Jul 2015 16:42:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-arcpy-tabletoexcel-conversion-in-script-tool/m-p/111763#M8698</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2015-07-02T16:42:13Z</dc:date>
    </item>
    <item>
      <title>Re: Using ArcPy.TableToExcel_conversion in Script Tool removes automatically added data</title>
      <link>https://community.esri.com/t5/python-questions/using-arcpy-tabletoexcel-conversion-in-script-tool/m-p/111764#M8699</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks again for your help Dan. I haven't edited/updated my code that is listed here, as none of it seems to be the issue/remedy (except obviously for the TableToExcel tool). I took out the try/except statements and just let the excel inputs run (after putting them in on the GUI) and the same situation happens. Very odd!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Jul 2015 17:02:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-arcpy-tabletoexcel-conversion-in-script-tool/m-p/111764#M8699</guid>
      <dc:creator>LanceWilson</dc:creator>
      <dc:date>2015-07-02T17:02:12Z</dc:date>
    </item>
    <item>
      <title>Re: Using ArcPy.TableToExcel_conversion in Script Tool removes automatically added data</title>
      <link>https://community.esri.com/t5/python-questions/using-arcpy-tabletoexcel-conversion-in-script-tool/m-p/111765#M8700</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok...what I am saying that with a try except block there is this&lt;/P&gt;&lt;P&gt;try:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; try to see if this works&lt;/P&gt;&lt;P&gt;except:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pass&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you put pass NO error message will show up at all unless it triggers some system/python/etc error&lt;/P&gt;&lt;P&gt;Why not change it to&lt;/P&gt;&lt;P&gt;try:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; whatever&lt;/P&gt;&lt;P&gt;except:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print("oops")&lt;/P&gt;&lt;P&gt;as a minimum, you can actually trap error messages should the try part fail,&amp;nbsp; check out arcpy.AddMessage and the other options in the message section it is worth a shot .... if all goes well, then you do have a mysterious error and need to pass it on to tech support...especially since no one else is chiming in.&amp;nbsp; Good luck&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Jul 2015 18:20:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-arcpy-tabletoexcel-conversion-in-script-tool/m-p/111765#M8700</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2015-07-02T18:20:05Z</dc:date>
    </item>
    <item>
      <title>Re: Using ArcPy.TableToExcel_conversion in Script Tool removes automatically added data</title>
      <link>https://community.esri.com/t5/python-questions/using-arcpy-tabletoexcel-conversion-in-script-tool/m-p/111766#M8701</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, Dan. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My apologies for not being clearer, I did/do understand what you were trying to say about the try/except and that by using "pass", I am simply letting it go without any helpful error messages. The main purpose for this (at the moment) is that I'm still writing the code (there is still more functionality that I want to accomplish after I figure out this mysterious occurrence). I wouldn't have even used the try/except code, because obviously TableToExcel would give its own errors if something went wrong. I merely am using the try/except/pass because of the fact that the excel inputs are optional for the user via the GUI (because the main purpose is to output a feature class, but some do/may want an excel file). In the case that someone doesn't want an excel file, I didn't want the script to freak out because there was no input for it and I don't need any error message to show, it just needs to simply carry along with the rest of the process (pass).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again, and by the way, I've never sent any issues to tech support. Is there a specific way I should go about doing this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Jul 2015 18:31:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-arcpy-tabletoexcel-conversion-in-script-tool/m-p/111766#M8701</guid>
      <dc:creator>LanceWilson</dc:creator>
      <dc:date>2015-07-02T18:31:57Z</dc:date>
    </item>
    <item>
      <title>Re: Using ArcPy.TableToExcel_conversion in Script Tool removes automatically added data</title>
      <link>https://community.esri.com/t5/python-questions/using-arcpy-tabletoexcel-conversion-in-script-tool/m-p/111767#M8702</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok...gotcha&lt;/P&gt;&lt;P&gt;As for reporting a problem...I must admit, I do kindof circumvent the system...however apparently&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.esri.com/en/" title="http://support.esri.com/en/"&gt;Esri Support&lt;/A&gt;&amp;nbsp; is the link.&amp;nbsp; If you have your own license then away you go...if someone else is responsible, then they have to do it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Jul 2015 18:41:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-arcpy-tabletoexcel-conversion-in-script-tool/m-p/111767#M8702</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2015-07-02T18:41:19Z</dc:date>
    </item>
    <item>
      <title>Re: Using ArcPy.TableToExcel_conversion in Script Tool removes automatically added data</title>
      <link>https://community.esri.com/t5/python-questions/using-arcpy-tabletoexcel-conversion-in-script-tool/m-p/1189578#M64926</link>
      <description>&lt;P&gt;I encountered this issue today, still no resolution I can find on any of the message boards 7 years later...&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jul 2022 18:53:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-arcpy-tabletoexcel-conversion-in-script-tool/m-p/1189578#M64926</guid>
      <dc:creator>Dwight</dc:creator>
      <dc:date>2022-07-05T18:53:10Z</dc:date>
    </item>
  </channel>
</rss>

