#include <Excel.au3>
$oExcel = _ExcelBookNew()
_ExcelWriteCell($oExcel, 'A1', 1, 1)
_ExcelWriteCell($oExcel, 'B1', 1, 2)
$oExcel.Application.DisplayAlerts = False
Sleep(1000)
;1
$oExcel.Range('A1:D3').Merge
Sleep(1000)
$oExcel.Range('A1:D3').UnMerge
Sleep(1000)
;2
$oExcel.Range('B2:E3').Select
$oExcel.Selection.MergeCells = True
Sleep(1000)
$oExcel.Selection.MergeCells = False
Sleep(1000)
$oExcel.Activesheet.Cells(1, 1).Select
$oExcel.Application.DisplayAlerts = True