Stuck here scratching my head again.
I am trying to write a formula =IF(AND(X2="X",Y2=""),1,"") to the B2 cell in excel.
However, my code does not put anything in. I also don't get any errors.
#include <Excel.au3> Local $oWorkbook $oExcel = _Excel_Open() $sWorkbook = @ScriptDir & "\VitalSite" & " " & @Mon & "_" & @MDAY & "_" & @Year & ".xlsx" $oWorkbook = _Excel_BookOpen($oExcel,$sWorkbook) _Excel_RangeWrite($oWorkbook,Default, '=IF(AND(X' & 2 & '="X",Y' & 2 & '=""),1,"Hello"', "B" & 2)
hi, i am using commands like the below to print values to excel, the array has 20 values, do i have to manually type as a1, b1, c1, d1.... till t1 or is there a short cut(loop) by which i can get the 20 elements printed in a particular row(here row 1) of excel?
_Excel_RangeWrite($oWorkbook, 1, $array, "a1")
_Excel_RangeWrite($oWorkbook, 1, $array, "b1")
_Excel_RangeWrite($oWorkbook, 1, $array, "c1")
I need to save the text with excel, each save is 1 row and 2 columns, i did and it does not work please help me Local $oExcel = _Excel_Open() If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_RangeWrite Example", "Error creating the Excel application object." & @CRLF & "@error = " & @error & ", @extended = " & @extended) Local $oWorkbook = _Excel_BookNew($oExcel) If @error Then MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_RangeWrite Example", "Error creating the new workbook." & @CRLF & "@error = " & @error & ", @extended = " & @extended) _Excel_Close($oExcel) Exit EndIf For $i = 1 To 10 Local $aArray2D = [[$i],] _Excel_RangeWrite($oWorkbook, $oWorkbook.Activesheet, $aArray2D, "A"&$i&"") Next error_excel.bmp
I am a beginner and I am currently learning and practicing what Autoit can do, so kindly pardon if it sound's silly.
What my program does ----> I had written a program where I have a FOR (i=0 to n) loop which is running for n times. Inside the FOR loop, contents of array is written into excel using _Excel_RangeWrite .
_Excel_RangeWrite($oExcelDoc, $oExcelDoc.Activesheet, $arrayname, "A1") Problem ------> During every loop run the contents of column A is only altered
What i intend to do ------> For every loop run (i=0,1,2,3...) I want to write the array contents into respective next adjacent excel columns
i.e) For i=0 loop, every array content should be written in A Column of excel
For i = 1 loop, every array content should be written in B Column of excel.
Can anyone give me an idea of how can i do this? Thanks
First, I thank you for all the help I received here with Excel UDFs and COM objects in the last few days/week.
I would like to "pimp" my output excel a bit, and for that I would like to write some results Bold.
How do I do that?
I tried a few things but most return errors, or doesn't do a thing seemingly.
My code right now, this does run, but doesn't make the inserted results bold. (by inserted I mean what I write with _Excel_RangeWrite)
_Excel_RangeWrite($ExcelObject, $ExcelObject.Activesheet, "=" & $OSSZEGoszlop & $CellaOlvasoSzamlalo & "*" & String($ArfolyamArray[$DateArrayTimeIndex]) & "", String($sHUFBeszurOszlop) & $CellaOlvasoSzamlalo) $ExcelObject.Activesheet.Range(String($sHUFBeszurOszlop) & $CellaOlvasoSzamlalo).Bold = True Thank you for the help!
Edit: I leave this here, added the bold tag, maybe someone find it usefull