Я пытаюсь сделать относительно простое копирование и вставку из Excel 2007 в Word 2007. Я просмотрел этот сайт и другие и продолжаю зацикливаться на одном и том же - третья строка в приведенном ниже коде продолжает давать мне " Определено примечание типа пользователя «сообщение об ошибке. Я действительно запутался, так как я только что поднял это из другого решения (и у меня были аналогичные проблемы с другими решениями, которые я пытался поднять). Может ли кто-нибудь рассказать мне, что вызывает ошибку и почему?
Sub ControlWord()
' **** The line below gives me the error ****
Dim appWD As Word.Application
' Create a new instance of Word & make it visible
Set appWD = CreateObject("Word.Application.12")
appWD.Visible = True
'Find the last row with data in the spreadsheet
FinalRow = Range("A9999").End(xlUp).Row
For i = 1 To FinalRow
' Copy the current row
Worksheets("Sheet1").Rows(i).Copy
' Tell Word to create a new document
appWD.Documents.Add
' Tell Word to paste the contents of the clipboard into the new document
appWD.Selection.Paste
' Save the new document with a sequential file name
appWD.ActiveDocument.SaveAs Filename:="File" & i
' Close this new word document
appWD.ActiveDocument.Close
Next i
' Close the Word application
appWD.Quit
End Sub