关于VB 调用Application.WorksheetFunction.CountIf问题
Set objExcel = New Excel.ApplicationSet objWorkBook = objExcel.Workbooks.Open(path, 3, False)
Set objWorkSheet = objWorkBook.Worksheets(1)
objWorkSheet.Select
maxcol = objWorkSheet.Cells(1, 1).End(xlToRight).Column
maxrow = objWorkSheet.Cells(65536, selcolnumb).End(xlUp).Row
enaddr = objWorkSheet.Cells(maxrow, selcolnumb).Address
beaddr = objWorkSheet.Cells(2, selcolnumb).Address
MsgBox Application.WorksheetFunction.CountIf(objWorkSheet.Range(beaddr & ":" & enaddr), objWorkSheet.Range(enaddr))
objExcel.Quit
我有这么的一段代码,第一次执行的时候 Application.WorksheetFunction.CountIf(objWorkSheet.Range(beaddr & ":" & enaddr), objWorkSheet.Range(enaddr))
是有成功的数据出来 但是第二次执行就会报错 提示实时错误13 类型不匹配
这个问题是什么原因导致的啊
--------------------编程问答-------------------- 有老师帮忙解决么 很是急
补充:VB , 基础类