将选定范围 Excel 粘贴到 Word 文档

Pasting a selected range from Excel to a Word document

我正在将我在 Excel VBA 中编写的代码转换为 VS 2017 上的 vb.NET。当我 运行 代码时,出现错误

This method or property is not available because the Clipboard is empty or not valid.

此消息在应用程序 运行 正在尝试将所选范围从 Excel 粘贴到 Word 文档时出现。当代码 运行s 时,我一直保持正在复制的工作表可见,并且可以看到它选择了正确的范围但实际上并没有复制它。

在 vb.NET 中复制单元格区域的正确方法是什么?

这是我的代码中发生错误的部分:

                excelApp = New Excel.Application
                excelWB = excelApp.Workbooks.Open(SurveyFormLoc)
                excelApp.Visible = True
                With excelApp

                    .Sheets("Site Details").Select

                    .Range("B2:I11").Copy()

                End With

                excelWB.Save()

                wdApp = CreateObject("Word.Application")
                wdApp.Visible = False
                wdDoc = wdApp.Documents.Open(DesignReportLoc)

                With wdDoc

                    .Application.Selection.Find.Text = "INSERT FROM SURVEY FORM"        
                    .Application.Selection.Find.Execute()
                    .Application.Selection.ParagraphFormat.Alignment = 0

                End With

                With wdApp

                    .Selection.PasteSpecial(Link:=True, DataType:=0, Placement:=0, DisplayAsIcon:=False) 'Asked question to get this 
                    .Selection.TypeParagraph()

                End With

问题可能是 excelWB.Save() 重置了副本选择?同样的事情也发生在用户界面中。