Silvinho Posted November 21, 2007 Share Posted November 21, 2007 How to read data of an Excel worksheet? In the example below am reading data of a txt file Run("CadCli.exe") $file = FileOpen("c:\Familia.txt", 0) While 1 $Whole_Line = FileReadLine($File) $Columns = StringSplit($Whole_Line, "|") $First_Column = $Columns[1] $Second_Column = $Columns[2] If @error = -1 Then ExitLoop WinWaitActive("Cadastro de Clientes") ControlClick("Cadastro de Clientes", "", "[CLASS:TEdit;INSTANCE:2]") Send($First_Column) ControlClick("Cadastro de Clientes", "", "[CLASS:TEdit;INSTANCE:1]") Send($Second_Column) ControlClick("Cadastro de Clientes", "", "[CLASS:TButton; TEXT:Gravar; INSTANCE:2]") Send("{ENTER}") Wend FileClose($Whole_Line) MsgBox(0, "Teste", "Todos os arquivos foram gravados com sucesso") Link to comment Share on other sites More sharing options...
Moderators big_daddy Posted November 22, 2007 Moderators Share Posted November 22, 2007 You will be pleased to know there is an ExcelCOM UDF that makes this feat pretty easy. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now