找回密码
 加入
搜索
查看: 4223|回复: 5

如何得到一个excel表格的行数?

[复制链接]
发表于 2009-3-26 10:28:25 | 显示全部楼层 |阅读模式
如题,有函数么?
发表于 2009-4-28 15:35:30 | 显示全部楼层
顶一个先,我也碰到了这个问题,一个文件不知有多少行,有这要的函数吗?
发表于 2009-4-28 15:41:26 | 显示全部楼层
是不是这一个



; ***************************************************************
; Example 1 - Write to a Cell using a Loop, after opening a workbook and returning its object identifier.  Read the cells into an array, display array,
;               then Save and Close file.
; *****************************************************************

#include <Excel.au3>
#include <Array.au3>

Local $oExcel = _ExcelBookNew() ;Create new book, make it visible

For $i = 1 To 5 ;Loop
    _ExcelWriteCell($oExcel, $i, $i, 1) ;Write to the Cell Vertically using values 1 to 5
Next

For $i = 1 To 5 ;Loop
    _ExcelWriteCell($oExcel, Asc($i), 1, $i + 2) ;Write to the Cell Horizontally, using Asc just to use different values for reading purposes
Next

$aArray1 = _ExcelReadArray($oExcel, 1, 1, 5, 1) ;Direction is Vertical
$aArray2 = _ExcelReadArray($oExcel, 1, 3, 5) ;Direction is Horizontal
_ArrayDisplay($aArray2, "Horizontal")
_ArrayDisplay($aArray1, "Vertical")

MsgBox(0, "Exiting", "Press OK to Save File and Exit")
_ExcelBookSaveAs($oExcel, @TempDir & "\Temp.xls", "xls", 0, 1) ; Now we save it into the temp directory; overwrite existing file if necessary
_ExcelBookClose($oExcel) ; And finally we close out
发表于 2009-12-16 20:03:11 | 显示全部楼层
ei ~~ 我也遇到这个问题了~~~
发表于 2009-12-16 20:18:32 | 显示全部楼层
$aArray = _ExcelReadSheetToArray($oExcel)
[0][0]行数 [0][1]列数
发表于 2009-12-16 20:46:11 | 显示全部楼层
感谢~~ 问题解决~~
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-9-22 15:43 , Processed in 0.081647 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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