Jump to content

Error: Variable must be of type "Object"


Recommended Posts

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 by pedrosojones
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...