ArcGIS Desktop

  • Documentation
  • Support

  • My Profile
  • Help
  • Sign Out
ArcGIS Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS Desktop

A complete professional GIS

ArcGIS Enterprise

GIS in your enterprise

ArcGIS for Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

ArcMap

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • Extensions

Table To Excel

  • Summary
  • Usage
  • Syntax
  • Code sample
  • Environments
  • Licensing information

Summary

Converts a table to a Microsoft Excel file.

Usage

  • Table To Excel converts only to Microsoft Excel 5.0/95 Workbook (.xls) format.

Syntax

TableToExcel_conversion (Input_Table, Output_Excel_File, {Use_field_alias_as_column_header}, {Use_domain_and_subtype_description})
ParameterExplanationData Type
Input_Table

The table to be converted to Microsoft Excel format.

Table View
Output_Excel_File

The output Microsoft Excel file.

File
Use_field_alias_as_column_header
(Optional)

How column names in the output are determined.

  • NAME —Column headers will be set using the input's field names. This is the default.
  • ALIAS —Column headers will be set using the input geodatabase table's field aliases. If the input is a layer in a map, the value set on the layer's field alias is ignored.
Boolean
Use_domain_and_subtype_description
(Optional)

Controls how values from subtype fields or fields with a coded value domain are transferred to the output.

  • CODE —All field values will be used as they are stored in the table. This is the default.
  • DESCRIPTION —For subtype fields, the subtype description will be used. For fields with a coded value domain, the coded value descriptions will be used.
Boolean

Code sample

TableToExcel example (Python window)

The following Python window script demonstrates how to use the TableToExcel function in immediate mode.

import arcpy
arcpy.env.workspace = "c:/data"
arcpy.TableToExcel_conversion("gdb.gdb/addresses", "addresses.xls")
TableToExcel example 2 (stand-alone script)

Converts a table to a Microsoft Excel workbook.

# Name: TableToExcel_2.py

import arcpy

# Set environment settings
arcpy.env.workspace = "c:/data"

# Set local variables
in_table = "gdb.gdb/addresses"
out_xls = "addresses.xls"

# Execute TableToExcel
arcpy.TableToExcel_conversion(in_table, out_xls)

Environments

  • Current Workspace
  • Scratch Workspace
  • Transfer Field Domain Descriptions

Licensing information

  • ArcGIS Desktop Basic: Yes
  • ArcGIS Desktop Standard: Yes
  • ArcGIS Desktop Advanced: Yes

Related topics

  • An overview of the Excel toolset
  • Excel To Table

ArcGIS Desktop

  • Home
  • Documentation
  • Support

ArcGIS Platform

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Insiders Blog
  • User Conference
  • Developer Summit
Esri
Tell us what you think.
Copyright © 2017 Esri. | Privacy | Legal