开发者

win32com equivalent of xlrd's sheet.ncols

xlrd makes it pretty easy to know what the last column is.

is there an easy way using win32com?

I have t开发者_如何学运维ried using ws.UsedRange.Rows.Count but this doesnt seem to give a correct answer.


That's defined to give the count of rows in the used range (which may not start at cell A1). You need the number of columns in the worksheet.

Try something like this:

used = ws.UsedRange
nrows = used.Row + used.Rows.Count - 1
ncols = used.Column + used.Columns.Count - 1
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜