Python error

454
0
02-05-2014 11:57 AM
BarryGuidry
Occasional Contributor
I am simply using the ArcGIS Server Manager 10.0 web application wizard to run a geoprocessing model from within the associated map document. So, I the model sums acreage and writes the "Acreage" table to a geodatabase at specified location. I don't see a way to have the default web application builder display the Acreage results from within the web application, though. So, what I did was link the table to an Excel document. I am attempting to add a Python script to the model in order to open the Excel file to display the results, but get this error in the web application geoprocessing results:

Submitted. 

   Executing... 

   Executing (Acreage): Acreage 

   Start Time: Wed Feb 05 15:46:05 2014 

   Executing (Select Layer By Attribute): SelectLayerByAttribute "Fuel Load (Acreage)" NEW_SELECTION "SIMPLE = 'Heavy Grass'" 

   Start Time: Wed Feb 05 15:46:06 2014 

   Succeeded at Wed Feb 05 15:46:06 2014 (Elapsed Time: 0.00 seconds) 

   Executing (Get Count): GetCount "Fuel Load (Acreage)" 

   Start Time: Wed Feb 05 15:46:06 2014 

   Row Count = 5 

   Succeeded at Wed Feb 05 15:46:06 2014 (Elapsed Time: 0.00 seconds) 

   Executing (Summary Statistics): Statistics "Fuel Load (Acreage)" \\Path_to\webappdata.mdb\Acreage "ACREAGE SUM" # 

   Start Time: Wed Feb 05 15:46:06 2014 

   Succeeded at Wed Feb 05 15:46:09 2014 (Elapsed Time: 3.00 seconds) 

   Executing (openxl): openxl 

   Start Time: Wed Feb 05 15:46:10 2014 

   Running script openxl... 

   Error: : unexpected indent (acreage.py, line 7) 

   Error: Failed to execute (openxl). 

   Failed at Wed Feb 05 15:46:12 2014 (Elapsed Time: 2.00 seconds) 

   Error: Failed to execute (Acreage). 

   Failed at Wed Feb 05 15:46:13 2014 (Elapsed Time: 8.00 seconds) 

   Error: Failed.

Here is the Python script:
## Import win32 to interact with Excel application
import win32com.client as win32

## To open Acreage table in Excel
excel = win32.gencache.EnsureDispatch('Excel.Application')
excel.Visible = True
excel.Workbooks.Open(\\Path_to\Landuse\Acreages.xlsm)

Can anyone let me know what problem I may have in the script?
Tags (2)
0 Kudos
0 Replies