Jump to content

Recommended Posts

Posted

hi

My program use some *.txt files (notepad) and i wanna put all those informattion from *.txt files to one exel file. And then program will open only one file (probably program will run faster) and search exels lines (possillby also some colums A,B,C etc)

I have tried save information to exel file but then AutoIt3 cant count lines.

Posted

search for excelCOM.au3

thx man

i have downloaded it, unziped and paste into D:\Program Files\AutoIt3\Include ( to use <include>)

i have read script but still need simple code example to see how to use this excelCOM.au3 file.

i have xxx.xls file on desktop

some rows and 2 colums (1 column - number, 2 - text )

can anyone paste here simple example how can i open this file (not run if it is possible)

and do something like this :

$x = (1 row, 1 column)

$y = (2 row, 2 column)

msgbox(0,"1 row, 1 column",$x)

msgbox(0,"2 row, 2 column",$y)

Posted (edited)

Hi,

Try unzipping all the zip file to current directory;

then try

"_XLArrayExample2Single.au3"

or

"XLsyntaxshort3.au3"

to give you some idea.

let me nkow if you're still in doubt.

Best ,Randall

[PS they will run, "NOT visible" if you set that parameter to zero]

Edited by randallc
Posted

Hi,

Try unzipping all the zip file to current directory;

then try

"_XLArrayExample2Single.au3"

or

"XLsyntaxshort3.au3"

to give you some idea.

let me nkow if you're still in doubt.

Best ,Randall

[PS they will run, "NOT visible" if you set that parameter to zero]

i have pasted all unziped files to /include ...

when i try run "_XLArrayExample2Single.au3" or any other file from there there is error :

Error reading the file:

GuiListView.au3

i have searched this file on my all HDD , but i didt find it :P

Posted (edited)

Hi,

Yes, As I said:

"Try unzipping all the zip file to current directory"

I don't know that it is ever a good idea to try to run from that "Include" directory; use a different main script directory and put all these unzipped files there instead?...

Randall

ok

i make new folder E:\ExcelExamples and here i have unziped all files from ExcelExamples.zip (10 files after unziped)

i have run "_XLArrayExample2Single.au3" from ther directory and still have the same error

do i have to do any change in code before i run "_XLArrayExample2Single.au3" ?

code :

#include"ExcelCom.au3"

;#include <Array.au3>

$FilePath=@ScriptDir&"\Blank5.xls"

$DataString="12,7,6,9,23,45,3,17,18,9"&@CRLF&"3,12,7,6,9,23,45,3,17,18"&@CRLF&"3,12,8,6,9,23,45,3,17,18"&@CRLF&"3,12,9,6,9,23,45,3,17,18"

$DataString=StringReplace($DataString,",",@TAB)

;MsgBox(0,"","$DataString="&$DataString)

$XLRange=_XLpaste($FilePath,1,"Z",11,$DataString,1)

;MsgBox(0,"","$XLRange="&$XLRange)

$XLArray=_XLArrayRead($FilePath,1,$XLRange)

_Array2dDisplay($XLArray, "Array as read",0)

_Array2DTo1D($XLArray,"Array", 0,9,1)

_XLShow($FilePath,1,"Z",11)

MsgBox(0,"","Here, Sheet 1")

_XLClose($FilePath,1)

do i have to change this line :

$FilePath=@ScriptDir&"\Blank5.xls" for $FilePath=@ScriptDir&"\xxx.xls" and paste xxx.xls file in the same directory (E:\ExcelExamples)

or just have to download missing file : GuiListView.au3

i have brainstorm and dont know what i have to do :P

Edited by Jack_10
Posted

Yes, but that should not be your error

"$FilePath=@ScriptDir&"\Blank5.xls" for $FilePath=@ScriptDir&"\xxx.xls" and paste xxx.xls file in the same directory (E:\ExcelExamples)"

can you plesae post the console output from your error?

maybe you have a wrong autoIt version? 3.2.0.0 or later?

Best, Randall

Posted (edited)

Yes, but that should not be your error

"$FilePath=@ScriptDir&"\Blank5.xls" for $FilePath=@ScriptDir&"\xxx.xls" and paste xxx.xls file in the same directory (E:\ExcelExamples)"

can you plesae post the console output from your error?

maybe you have a wrong autoIt version? 3.2.0.0 or later?

Best, Randall

ye !!!

i have 3.1.1.0 version

do i have to download new or just use update "check for updates"

ok i have new version 3.2.0.1 anf now have this mising file !! and work !

thx man one more time

Edited by Jack_10
Posted (edited)

hi

instructionsI think you won't need beta version straight away; but 3.2.0.0 needs un-install of old version first, I think.

best, Randall

ok next problem :P

i have run "XLsyntaxshort3" to read 1 row and A column. like this :

#include"ExcelCom.au3"

$FilePath=@ScriptDir&"\xxx.xls"

$var1=_XLread($FilePath,1,"A1",1,1)

msgbox (0,"_XLread=",$var1)

(in excel 1 row,1 column is big number : 1772025543)

and autoit read is like : 1772025600

another example (in excel 1 row,1 column is big number : 3049121675)

and autoit read is like : 3049121792

probably have to increase numer after decimal point or something like this ...

Edited by Jack_10
Posted (edited)

Yes, I think there is a bug report in about AutoIt new version [COM, not the Excel UDF as I understand it, as happens elsewhere], and awaiting outcome; used not to be a problem, i think. [see 3 links below]

the information read is NOT the same that is written

copy/paste bug back with .133, Fixed 3.2.1.1

Yes, it's fixable

..

May have to wait..

Randall

[did you go to the beta version, 3.2.1.1?]

PS - I have tried Blitzkrg's example script and it is working OK in that version.! - good luck

Edited by randallc
Posted

Yes, I think there is a bug report in about AutoIt new version [COM, not the Excel UDF as I understand it, as happens elsewhere], and awaiting outcome; used not to be a problem, i think. [see 3 links below]

the information read is NOT the same that is written

copy/paste bug back with .133, Fixed 3.2.1.1

Yes, it's fixable

..

May have to wait..

Randall

[did you go to the beta version, 3.2.1.1?]

PS - I have tried Blitzkrg's example script and it is working OK in that version.! - good luck

ye bete is ok for this script and solution for this problem ... but i hope so beta doestn give me more problems then profit :P

are there any big bug in beta that can hurt my script that was writen in 3.2.0.1 verion ?

Posted

Hi,

Personally, i don't think it's likely to be a problem; but i'm not a developer!

PS You will find, if you are reading and manipulating data from one or 2 sheets only at a time, that reading the sheet to an array is fast [using _XLArrayRead func]; then manipulate it in AutoIt; then save back the array [_XLArrayWrite] - see examples for use.

It saves on repeated com calls to excel.

Best, Randall

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...