pedrosojones Posted June 17, 2011 Share Posted June 17, 2011 (edited) Hi, Can you help me for the following error: (9) : ==> Variable must be of type "Object".: $oExcel.Range("A"&$2i).Select $oExcel^ ERROR #include <File.au3> #include <Excel.au3> $oExcel = _ExcelBookOpen("C:\Program Files\DIGIT APPS\CLEAN\Clean_log.xls") $today = (@MDAY & "/" & @MON & "/" & @YEAR) $time = (@HOUR & ":" & @MIN) For $2i = 1 To 2000 ;Loop $oExcel.Range("A"&$2i).Select if $oExcel.Application.ActiveCell.Value = "" then _ExcelWriteCell($oExcel, $today , $2i , 1) _ExcelWriteCell($oExcel, $time, $2i , 2) _ExcelWriteCell($oExcel, @ComputerName, $2i , 3) _ExcelWriteCell($oExcel, @UserName, $2i , 4) ;_ExcelWriteCell($oExcel, $Newuser, $i , 4) exitloop EndIf Next MsgBox(0, "Exiting", "Press OK to Save File and Exit") _ExcelBookSave($oExcel) ;Save File With No Alerts _ExcelBookClose($oExcel) ; And finally we close out Thank you Edited June 17, 2011 by pedrosojones Link to comment Share on other sites More sharing options...
MrMitchell Posted June 17, 2011 Share Posted June 17, 2011 it's possible $oExcel didn't open properly. Replace $oExcel = _ExcelBookOpen("C:\Program Files\DIGIT APPS\CLEAN\Clean_log.xls") with $oExcel = _ExcelBookNew() And see if you still get the same error? Link to comment Share on other sites More sharing options...
Zedna Posted June 17, 2011 Share Posted June 17, 2011 $oExcel = _ExcelBookOpen("C:\Program Files\DIGIT APPS\CLEAN\Clean_log.xls") If @error Then ... Resources UDF ResourcesEx UDF AutoIt Forum Search 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