Keyword Reference


With...EndWith

Used to reduce long references to dot-accessible type of variables.

With <expression>
statements
...
EndWith

Parameters

expression Must be an object type expression

Remarks

With...EndWith statements may be nested.

Related

For...In...Next

Example

Local $oExcel = ObjCreate("Excel.Application")
$oExcel.visible = 1
$oExcel.workbooks.add

With $oExcel.activesheet
    .cells(2, 2).value = 1
    .range("A1:B2").clear
EndWith

$oExcel.quit