回复 7# kk_lee69
KK 我把EXCEL.AU3 UDF里找到这个了。Func _Excel_RangeInsert($oWorksheet, $vRange, $iShift = Default, $iCopyOrigin = Default)
; Error handler, automatic cleanup at end of function
Local $oError = ObjEvent("AutoIt.Error", "__Excel_COMErrFunc")
#forceref $oError
If Not IsObj($oWorksheet) Or ObjName($oWorksheet, 1) <> "_Worksheet" Then Return SetError(1, 0, 0)
If Not IsObj($vRange) Then
$vRange = $oWorksheet.Range($vRange)
If @error Then Return SetError(2, @error, 0)
EndIf
$vRange.Insert($iShift, $iCopyOrigin)
If @error Then Return SetError(3, @error, 0)
Return $vRange
EndFunc ;==>_Excel_RangeInsert
|