Here's my code to copy a table into Word
Sub CopyTable()
Dim wdappWord As Word.Application
Dim docWord As Word.Document
Dim strFilename As String
Set wdappWord = GetObject(, "Word.Application")
'Set docWord = wdappWord.Documents.Add
strFilename = "C:\Excel\Excel Test.docx"
wdappWord.Visible = True
wdappWord.Documents.Open strFilename
ActiveWorkbook.ActiveSheet.Range("B2:I5").Select
Selection.Copy
wdappWord.Selection.PasteExcelTable True, False, False
End Sub
If I run this code about 4x in a row I get the following error message:
Runtime error '4605'
This method or property is not available because the clipboard is empty or not valid
What on earth does this error mean?
Sub CopyTable()
Dim wdappWord As Word.Application
Dim docWord As Word.Document
Dim strFilename As String
Set wdappWord = GetObject(, "Word.Application")
'Set docWord = wdappWord.Documents.Add
strFilename = "C:\Excel\Excel Test.docx"
wdappWord.Visible = True
wdappWord.Documents.Open strFilename
ActiveWorkbook.ActiveSheet.Range("B2:I5").Select
Selection.Copy
wdappWord.Selection.PasteExcelTable True, False, False
End Sub
If I run this code about 4x in a row I get the following error message:
Runtime error '4605'
This method or property is not available because the clipboard is empty or not valid
What on earth does this error mean?