Hi everyone
I am trying to copy from an existing excel template a specific range into an existing word doc. I get the error type 13 "Type mismatch". The error type 13 only pops up if I define more than one cell to copy.
Sub CreatWordReport()
Dim objWord
Dim objDoc
Dim objRange
Dim ws As Worksheet
Set ws = ThisWorkbook.Sheets("Summary")
Set objWord = CreateObject("Word.Application")
Set objDoc = objWord.Documents.Open("C:\Users\xxx\Desktop\test1.docx")
objWord.Visible = True
Set objRange = objDoc.Bookmarks("ManagementSummary").Range
objRange.InsertAfter ws.Range("A2", Range("A2").End(xlDown).End(xlToRight)).Value
End Sub
Does anyone see the mistake or the reason why I get this kind of error?
Thanks a lot for answering
I am trying to copy from an existing excel template a specific range into an existing word doc. I get the error type 13 "Type mismatch". The error type 13 only pops up if I define more than one cell to copy.
Sub CreatWordReport()
Dim objWord
Dim objDoc
Dim objRange
Dim ws As Worksheet
Set ws = ThisWorkbook.Sheets("Summary")
Set objWord = CreateObject("Word.Application")
Set objDoc = objWord.Documents.Open("C:\Users\xxx\Desktop\test1.docx")
objWord.Visible = True
Set objRange = objDoc.Bookmarks("ManagementSummary").Range
objRange.InsertAfter ws.Range("A2", Range("A2").End(xlDown).End(xlToRight)).Value
End Sub
Does anyone see the mistake or the reason why I get this kind of error?
Thanks a lot for answering