ArcGIS 10 - export to Excel

25162
29
07-20-2011 02:52 PM
StacyRendall1
Occasional Contributor III
The 'Export to Excel' model tool mentioned here: http://blogs.esri.com/Dev/blogs/arcgisdesktop/archive/2010/08/10/Working-with-Microsoft-Excel-in-Arc... and available here: http://resources.arcgis.com/gallery/file/geoprocessing/details?entryID=95009B25-1422-2418-7FB5-B8638... doesn't work with ArcGIS 10, as it relies on the old arcgisscripting library. I have fixed it up to use the new arcpy package, attached.

Remember you will need to download and install the xlwt package, available http://pypi.python.org/pypi/xlwt, for Python to be able to export to Xls. If your Xlwt installation fails, check out my post in this thread: http://forums.arcgis.com/threads/34418-Is-it-possible-to-install-other-Python-distributions-on-top-o....

I have only tested it on one file, and haven't tested the CSV output, so let me know if you have any issues.
Tags (2)
29 Replies
MeredithTrapp
New Contributor
thank you, very helpful
0 Kudos
RobertThomson
Occasional Contributor II
THANKS!  I've been needing something like this for a longtime.
0 Kudos
KarinHenrikson
New Contributor II
Oh, I love this tool! And it also works with selected fetaures and keeps our swedish letters �? �? �? as they should look!
Thanks!:)
/Karin Henrikson
WSP Sweden
0 Kudos
DaveDonley
New Contributor
I downloaded and added the 'Export to Excel' model tool to a custom modelbuilder script.  Great tool!  Thank you!!  I am not certain when or where I made the error, however; the XLS 'Date' column came across formatted as 'double', with unintelligible results (see attached).  Any suggestions as to how I can have the original dates convert without alteration?

Thank you for your time and effort!

Dave Donley
CAL FIRE - RRU
0 Kudos
StacyRendall1
Occasional Contributor III
Dave,

dates are actually stored in computers as days since 1900 (or sometimes 1901, I think), this is the number you are seeing. To show them as dates again you need to tell the program opening them that they are dates. So, if you open the output file in Excel, select the column and set format to date it should show in excel, and possibly when you open it in Arc again also. If that doesn't work, and you actually want to use the Excel file within Arc, you will probably need to make a new field of type date, and set it to the old field value, and it ought to convert.
0 Kudos
DaveDonley
New Contributor
Stacy,

Thank you for a prompt reply.  I will certainly give your suggestions a try, as soon as the weekend is over.

Keep up the great work!:cool:

Dave D.
0 Kudos
ClancyBlack
New Contributor II
Can anyone help me get this working in Arcmap? I know just enough programming to be dangerous but do not have a lot of experience with Python. I load the tool but it says there are no parameters, I assume when I load it I need to identify what the variables are? I tried running it directly in the python window and replaced all the "dataset" inputs with my dataset name. It still didn't work so I assume there is more I need to edit. I would prefer to be able to load it into a toolbox tool rather than running script in the python window.

Thanks for any help.
0 Kudos
StacyRendall1
Occasional Contributor III
You shouldn't have to program anything. Extract the contents of the zip file to a location. Navigate the ArcCatalog window (in ArcMap) to that location, expand the toolbox - called "Additional Conversion - Generic Tools" - then double click on the "Table to Excel" function in there. The parameters are already set up.
0 Kudos
ClancyBlack
New Contributor II
Thanks for your reply. It worked just fine, not sure why I didn't try that before.
0 Kudos