找回密码
 加入
搜索
查看: 2599|回复: 6

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

  [复制链接]
发表于 2010-2-4 14:33:42 | 显示全部楼层 |阅读模式
; 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[16][16]

  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
发表于 2010-2-4 14:39:25 | 显示全部楼层
菜鸟看不懂
发表于 2010-3-20 12:54:13 | 显示全部楼层
不明白说啥
发表于 2010-4-21 23:14:52 | 显示全部楼层
看不懂啊。
发表于 2010-4-22 12:20:23 | 显示全部楼层
纯粹水 水啊水啊水啊水
发表于 2010-10-11 17:06:46 | 显示全部楼层
看不懂是什么呢
发表于 2010-10-11 17:07:11 | 显示全部楼层
给个说明

或发个图嘛
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-11-25 11:28 , Processed in 0.101850 second(s), 20 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表