﻿id	summary	reporter	owner	description	type	status	milestone	component	version	severity	resolution	keywords	cc
2295	Help on ObjGet	MvL	guinness	"I had to add an empty function, to make example two work,
in the help on ObjGet.
{{{
   Func nothing()
   EndFunc
}}}

Also,
in order to activate the worksheet, I added
    $oExcelDoc.Application.Windows($Worksheet).Activate
in the code below,
See also my Example script:
    Getting the right Excel window, using ObjGet


{{{
Local $Worksheet = ""Worksheet.xls""
Local $Filename = ""C:\"" & $Worksheet

If Not FileExists($FileName) Then
    MsgBox(0, ""Excel File Test"", ""Can't run this test, because you didn't create the Excel file "" & $FileName)
    Exit
EndIf

Local $oExcelDoc = ObjGet($FileName) ; Get an Excel Object from an existing filename


If IsObj($oExcelDoc) Then

    ; Tip: Uncomment these lines to make Excel visible (credit: DaleHohm)
    $oExcelDoc.Windows(1).Visible = 1; Set the first worksheet in the workbook visible
    $oExcelDoc.Application.Visible = 1; Set the application visible (without this Excel will exit)

; and:
    $oExcelDoc.Application.Windows($Worksheet).Activate

    Local $String = """" ; String for displaying purposes

    ; Some document properties do not return a value, we will ignore those.
    Local $OEvent = ObjEvent(""AutoIt.Error"", ""nothing""); Equal to VBscript's On Error Resume Next

    For $Property In $oExcelDoc.BuiltinDocumentProperties
        $String = $String & $Property.Name & "":"" & $Property.Value & @CRLF
    Next

    MsgBox(0, ""Excel File Test"", ""The document properties of "" & $FileName & "" are:"" & @CRLF & @CRLF & $String)

    ; $oExcelDoc.Close ; Close the Excel document

Else
    MsgBox(0, ""Excel File Test"", ""Error: Could not open "" & $FileName & "" as an Excel Object."")
EndIf

}}}


"	Feature Request	closed	3.3.9.5	Documentation		None	Fixed	ObjGet	
