I am trying to make this code work, the problem is that in the excel file the print (...) data is not written, I have tried to use ws.appened (...) but without results.
import arcpy
from openpyxl import Workbook
wb = Workbook("C:/Users/Hp/Desktop/ejemplo/VINCULACION_S.xlsx")
ws = wb.active
rows = arcpy.SearchCursor("C:/Users/Hp/Desktop/ejemplo/VH_Dissolve.shp",
fields="COLOR; INTERNO_DE; CLASE_DEMA; COUNT_AREA; SUM_AREA; SUM_LENGTH",
sort_fields="COLOR 222; INTERNO_DE A")
# COLOR, INTERNO_DE, CLASE_DEMA, COUNT_AREA, SUM_AREA y SUM_LENGTH.
for row in rows:
print("Color: {0}, Interno: {1}, Clase:{2}, ContarA: {3}, SumarA: {4}, SumarL: {5}".format(
row.getValue("COLOR"),
row.getValue("INTERNO_DE"),
row.getValue("CLASE_DEMA"),
row.getValue("COUNT_AREA"),
row.getValue("SUM_AREA"),
row.getValue("SUM_LENGTH")))
wb.save('VINCULACION_S.xlsx')
I have also tried to locate the results data in the excel file from cell B3: G3 onwards but I can't find it.