Jump to content
Sign in to follow this  

AutoIt Excel COM usage.

Recommended Posts


I have been searching for an answer from the past two days.

Please let me know if anyone could help me on this?

here is my code;

Local $aTableData = _IETableWriteToArray($oTab, True)
Local $iRows = UBound($aTableData, $UBOUND_ROWS)
$oExcel = ObjCreate("Excel.Application")
With $oExcel
    .Visible = True
Global $xlMaximized = -4137
$oExcel.Application.Activewindow.WindowState = $xlMaximized
For $i = 1 To $iRows - 1
                  $oExcel.ActiveSheet.Cells($i,1).Value = $aTableData[$i][1]
                  $oExcel.ActiveSheet.Cells($i,2).Value = $aTableData[$i][3]
                  $oExcel.ActiveSheet.Cells($i,3).Value = $aTableData[$i][4]
                  If $aTableData[$i][3] == " Running" And $aTableData[$i][4] == " Enabled"  Then
                               $oExcel.ActiveSheet.Cells($i,4).Value = "All OK"
                               $oExcel.ActiveSheet.Cells($i,4).Interior.ColorIndex = 4
                               $oExcel.ActiveSheet.Cells($i,4).Value = "Not OK"
                               $oExcel.ActiveSheet.Cells($i,4).Interior.ColorIndex = 3

Till here my code works perfectly.

now i`m trying to activate my source bring out the data into an array and do the same thing again but this time i wanted add the data to the same excel as above but in the next sheet and then save the excel.


Could anyone guide me on this?


Thanks you very mcuh in advance.

Edited by Melba23

Share this post

Link to post
Share on other sites

Hello, and welcome.  Have you taken a look at the Excel UDF in the help file?  It uses a COM approach and has many functions pre-packaged.  There is also a wiki with lots more examples.  _Excel_RangeRead has a workbook and worksheet parameter and will read your range as an array.

Edited by Jfish

Build your own poker game with AutoIt: pokerlogic.au3 | Learn To Program Using FREE Tools with AutoIt

Share this post

Link to post
Share on other sites

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

Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.