boyhong 发表于 2010-2-4 14:33:42

如此之快的。。我用自带的UDF就不成了~~汗~~~

; Excel Automation Example
;
; Using direct assigments of 2-dimensional array's
;
; Based on AutoItCOM version 3.1.1
;
; Beta version 06-02-2005

$MyExcel = ObjCreate("Excel.Application")        ; Create an Excel Object

if @error then
Msgbox (0,"","Error creating Excel object. Error code: " & @error)
exit
endif

if not IsObj($MyExcel) then
Msgbox (0,"ExcelTest","I'm sorry, but creation of an Excel object failed.")
exit
endif


$MyExcel.Visible = 1                ; Let the guy show himself

$MyExcel.workbooks.add                ; Add a new workbook

                                ; Example: Fast Fill some cells

Msgbox (0,"","Click 'ok' to fastfill some cells")

dim $arr

for $i = 0 to 15
    for $j = 0 to 15
        $arr[$i][$j] = Chr($i+65)&($j+1)
    next
next   

; Set all values in one shot!
$MyExcel.activesheet.range("A1:O16").value = $arr


Msgbox (0,"","Click 'ok' to clear the cells")

$MyExcel.activesheet.range("A1:O16").clear

Sleep(2000)

$MyExcel.activeworkbook.saved = 1        ; To prevent 'yes/no' questions from Excel

$MyExcel.quit                                ; Get rid of him.

Msgbox (0,"ExcelTest","Is Excel gone now ?")
                                        ; Nope, only invisible,
                                        ; but should be still in memory.

$MyExcel = 0                ; Loose this object.
                                        ; Object will also be automatically discarded when you exit the script

exit

catcher 发表于 2010-2-4 14:39:25

:face (13):菜鸟看不懂

xiaochuan 发表于 2010-3-20 12:54:13

不明白说啥:face (13):

51ak 发表于 2010-4-21 23:14:52

看不懂啊。

karlpopper 发表于 2010-4-22 12:20:23

纯粹水 水啊水啊水啊水

q76609288 发表于 2010-10-11 17:06:46

看不懂是什么呢

q76609288 发表于 2010-10-11 17:07:11

给个说明

或发个图嘛
页: [1]
查看完整版本: 如此之快的。。我用自带的UDF就不成了~~汗~~~