#Define hTab Chr(9) #Define hCR Chr(13) oEx=Createobject("excel.application") N=Amembers(a, oEx, 3) && 3 gives you COM object PEMs cList="" cComma=" (" oEmpty=createobject("empty") For i=1 To N If a[i,2]="PropertyGet" cName=a[i,1] Try lOK=.T. uvalue=Getpem(oEx,cName) Catch lOK=.F. Endtry If Not lOK Loop Endif cType=Vartype(uvalue) Do Case *-- skip object and null properties Case cType$"OX" lOK=.F. Case cType="C" nLen=Len(uvalue) *-- scheck for null strings, and add space just in case nLen=iif(nlen=0, 10, int(nLen*1.5)) cLen="("+Transform(nLen)+")" Case cType$"NIFBY" *-- do a more precise one if needed... still, how to recognize integers? cLen="(18,2)" Case cType$"LDT" cLen="" Otherwise cLen="" Endcase If Not lOK Loop Endif addproperty(oEmpty, cName, uValue) cList = cList + cComma+cName + hTab+ cType+" "+cLen If i%3=2 cComma=","+hTab Else cComma=","+hTab+";"+hCR Endif Endif Endfor cList = cList + ")" *-- TEXT BLOCK BEGIN TEXT TO lcPrg NOSHOW TEXTMERGE lparameters oE create cursor crsFromExcel <<cList>> insert into crsFromExcel from name oE edit ENDTEXT *-- TEXT BLOCK END Strtofile(lcPrg, "cursorFromExcel.prg") execscript(lcPrg, oEmpty)Tried, works. At least for Excel.