
有哪为VB高手帮我看看我的程序这个程序错在哪?总是提示“集合所要求的成员不存在” 10
PrivateSubCommand1_Click()DimkAsIntegerDimjssappAsWord.ApplicationDimjssAsWord.Docume...
Private Sub Command1_Click()
Dim k As Integer
Dim jssapp As Word.Application
Dim jss As Word.Document
CommonDialog1.ShowOpen
Set jssapp = CreateObject("Word.Application")
If CommonDialog1.FileName = "" Then
MsgBox ("请重新选取路径")
Else
Set jss = jssapp.Documents.Open(CommonDialog1.FileName)
jssapp.Visible = True
While fWTT(jss.Tables(k).Cell(1, 1)) <> "计算结果" 'fWTT为去掉字符中的空格和小黑点
k = k + 1 And k <= 13
Wend
Text1.Text = k
End If
Set jssapp = Nothing
Set jss = Nothing
End Sub 展开
Dim k As Integer
Dim jssapp As Word.Application
Dim jss As Word.Document
CommonDialog1.ShowOpen
Set jssapp = CreateObject("Word.Application")
If CommonDialog1.FileName = "" Then
MsgBox ("请重新选取路径")
Else
Set jss = jssapp.Documents.Open(CommonDialog1.FileName)
jssapp.Visible = True
While fWTT(jss.Tables(k).Cell(1, 1)) <> "计算结果" 'fWTT为去掉字符中的空格和小黑点
k = k + 1 And k <= 13
Wend
Text1.Text = k
End If
Set jssapp = Nothing
Set jss = Nothing
End Sub 展开
1个回答
展开全部
因为在你打开的word文档中没有那么多的table,请检查一下k值,或者文档中的table没有cell(1,1),请检查一下word文档。
更多追问追答
追问
你好,谢谢你的回答。
第一,有什么办法可以获得table中数量;
第二,cell(1,1)我可以保证在word中都有。
追答
jss.tables.count就是文档中table的数量,你在调试时设置个断点,可以查看变量的

2023-06-12 广告
单片机汇编程序是用汇编语言编写的程序,用于控制单片机的操作。汇编语言是一种比较接近计算机硬件语言的低级语言,相对于高级语言来说更容易理解和实现。下面是单片机汇编程序的基本步骤:1. 将代码和数据汇编到规定的段中。2. 在存储器中用未初始化的...
点击进入详情页
本回答由意法半导体(中国)投资有限公司提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询