# EXCEL FILES PROBLEM

## Recommended Posts

HELLO To ALL WHAT I MUST DO IT IS TO READ The INFORMATION OF A EXCEL BOOK THAT I HAVE And THIS SAME INFORMATION IS WRITTEN IN A PAGUINA OF Internet, (The INFORMATION CAN BE SEPARATED BY COMMAS IN EXCEL)

##### Share on other sites

I am assuming that this:

(The INFORMATION CAN BE SEPARATED BY COMMAS IN EXCEL)

means it can be in a .csv file, if that is the case, i wrote a function awhile ago that pulls data from the .csv file here it is:

```;-------------------------------------------------------
;Function Name: table_cell_val()
;Purpose: This function goes into the table and retrieves
;        the data from the cell. Which cell it looks in
;        is determined by the parameters passed.
;Parameters: \$table - The data table to use
;           \$colName - The name of the column that the
;                      cell is located in.
;           \$row - Which row to use. *NOTE = row 1 is
;                  the column name row.
;-------------------------------------------------------
Func table_cell_val(\$table, \$colName, \$row)
\$colNum = 1

\$handle_a = FileOpen(\$table, 0)

; Check if file opened for reading OK
If \$handle_a = -1 Then
MsgBox(0, "Error", "Unable to open table.")
Exit
EndIf

\$array = StringSplit(\$string, ","); Splits up the location string
\$totCol = \$array[0]
While \$colNum <= \$totCol
If (\$colName == \$array[\$colNum]) Then
ExitLoop
Else
\$colNum = \$colNum + 1
EndIf
Wend

\$totRow = _FileCountLines(\$table)

\$array = StringSplit(\$string, ","); Splits up the location string
\$ret = \$array[\$colNum]

FileClose(\$handle_a)

Return \$ret
EndFunc```

Hope that helps...

## Create an account

Register a new account