Hi Wayne,1) I went to the "Home" manu => clicked on "Clear" to delete F5, F6 and F7 columnns of my xls file. Then I saved it and I executed the Python script in the Python Window of my ArcGIS 10.0. It worked and I got the right output without the blank F5, F6 and F7 columns in the Attribute Table.2) I added a new column "Z" and the values for the 10 points. Then I executed the newly revised script:>>> # scMakeXYlayer.py for 10 points of ApgRImmrp: X-, Y-, and Z-coord in the xls & the .py file
... # Description: Creates an XY layer and uses CopyFeatures to save it to a layer file
... # Author: ESRI - modified by Scott Chang per Arkadiusz Matoszka & Wayne Whitley (Date: 31 Oct 2012)
... # import system modules
... import arcpy
... from arcpy import env
... # Set environment settings
... # env.workspace = r"C:\TEMP\BS_Test.gdb" # New!!!
...
... try:
... # Set the local variables
... # in_Table = "firestations.csv"
... tb = r"C:\TEMP\WritingGeometries\ApgRImmrpWGS.xls\ApgRImmrpWGS$"
... xc = "X"
... yc = "Y"
... zc = "Z"
... out_Layer = "Pointlocations_layer"
... saved_Layer = r"c:\TEMP\APGriMMRPBHsWell.shp" # not .layer!!!
...
... # Set the spatial reference
... spRef = r"Coordinate Systems\Projected Coordinate Systems\Utm\Nad 1983\NAD 1983 UTM Zone 11N.prj"
... # spRef = r"Coordinate Systems\Geographic Coordinate System\World\WGS 1984"
...
... # Make the XY event layer...
... arcpy.MakeXYEventLayer_management(tb, xc, yc, out_Layer, spRef)
...
... # Print the total rows
... print arcpy.GetCount_management(out_Layer)
...
... # Save to a layer file
... # arcpy.SaveToLayerFile_management(out_Layer, saved_Layer)
... arcpy.CopyFeatures_management(out_Layer, saved_Layer) # New!!!
... except:
... # If an error occurred print the message to the screen
... print arcpy.GetMessages()
...
Executing: MakeXYEventLayer C:\TEMP\WritingGeometries\ApgRImmrpWGS.xls\ApgRImmrpWGS$ X Y Pointlocations_layer "PROJCS['NAD_1983_UTM_Zone_11N',GEOGCS['GCS_North_American_1983',DATUM['D_North_American_1983',SPHEROID['GRS_1980',6378137.0,298.257222101]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]],PROJECTION['Transverse_Mercator'],PARAMETER['False_Easting',500000.0],PARAMETER['False_Northing',0.0],PARAMETER['Central_Meridian',-117.0],PARAMETER['Scale_Factor',0.9996],PARAMETER['Latitude_Of_Origin',0.0],UNIT['Meter',1.0]];-5120900 -9998100 10000;-100000 10000;-100000 10000;0.001;0.001;0.001;IsHighPrecision" #
Start Time: Wed Oct 31 13:31:34 2012
Failed to execute. Parameters are not valid.
ERROR 000725: Layer Name or Table View: Dataset Pointlocations_layer already exists.
Failed to execute (MakeXYEventLayer).
Failed at Wed Oct 31 13:31:34 2012 (Elapsed Time: 0.00 seconds)
>>>
It did not work at all. I am lost now. Please help and advise again.Thanks,Scott Chang