无法使用垂直合并的单元格向Word表格添加行(Word Doc上的VBA Excel宏)

时间:2017-06-23 19:24:52

标签: excel vba excel-vba ms-word

我无法在字表中添加行!这就是表格的样子: Word Table Image

代码:

wdFileName = Application.GetOpenFilename("Word files (*.docx),*.docx", , "Please choose a file containing requirements to be imported")

If wdFileName = False Then Exit Sub '(user cancelled import file browser)


Set wdDoc = GetObject(wdFileName) 'open Word file

With wdDoc

Set CurrentTable = wdDoc.Tables(1)
Set AddRow = CurrentTable.Rows.Add(AfterRow:=CurrentTable.Rows(9))

End With

错误消息:无法访问此集合中的各个行,因为该表具有垂直合并的单元格。

(Word Doc上的VBA Excel宏)

0 个答案:

没有答案