Hallo @all,
how can i get the Fieldlength from a Cell from Excel.
For example A1, the sheet1 called Name, there are Names with 30 sin and one with 15, others with 40 and so on, is there funktion or what ever who says the cell is 50 sin long.
Thanks for your help.
Lorenz
I use this code:
PUBLIC ARRAY myArray[26]
LOCAL x,y
x = 1
y = 0
lcExceldaten = GETFILE('xls', 'open excel-file ', 'open', 1, 'Find the excel-file to open')
o=Createobject("excel.application" &&Create an Excel instance
myDoc=o.Workbooks.Open(lcExceldaten) && Open the workbook
myDoc.Worksheets(1).Select && Make sheet 1 the active sheet
mySheet=myDoc.ActiveSheet && Make a variable of the active sheet
For i = 65 To 150 && Or whatever the highest instance could be
cLetter = CHR(i)
If !ISNULL(mySheet.Range(cLetter+"1".Value) && Check to see if there is an acutal value
myArray[x]=mySheet.Range(cLetter+"1".Value
x = x + 1
ELSE
FOR j = 1 TO ALEN(myArray)
IF !EMPTY(myArray[j])
y =y +1
lc = strtran((myArray[j])," ","_"
endif
ENDFOR
PUBLIC ARRAY myArray2[y]
FOR j = 1 TO ALEN(myArray)
IF !EMPTY(myArray[j])
myArray2[j]=myArray[j]
endif
ENDFOR
Exit
Endif
Next
how can i get the Fieldlength from a Cell from Excel.
For example A1, the sheet1 called Name, there are Names with 30 sin and one with 15, others with 40 and so on, is there funktion or what ever who says the cell is 50 sin long.
Thanks for your help.
Lorenz
I use this code:
PUBLIC ARRAY myArray[26]
LOCAL x,y
x = 1
y = 0
lcExceldaten = GETFILE('xls', 'open excel-file ', 'open', 1, 'Find the excel-file to open')
o=Createobject("excel.application" &&Create an Excel instance
myDoc=o.Workbooks.Open(lcExceldaten) && Open the workbook
myDoc.Worksheets(1).Select && Make sheet 1 the active sheet
mySheet=myDoc.ActiveSheet && Make a variable of the active sheet
For i = 65 To 150 && Or whatever the highest instance could be
cLetter = CHR(i)
If !ISNULL(mySheet.Range(cLetter+"1".Value) && Check to see if there is an acutal value
myArray[x]=mySheet.Range(cLetter+"1".Value
x = x + 1
ELSE
FOR j = 1 TO ALEN(myArray)
IF !EMPTY(myArray[j])
y =y +1
lc = strtran((myArray[j])," ","_"
endif
ENDFOR
PUBLIC ARRAY myArray2[y]
FOR j = 1 TO ALEN(myArray)
IF !EMPTY(myArray[j])
myArray2[j]=myArray[j]
endif
ENDFOR
Exit
Endif
Next