Error when I try to paste Excel range into Word VBA

38 Views Asked by At

I am using the below code to copy a range of cells from Excel to Word. I have an instance of Word open (blank document). When I run the code, nothing happens. This used to work fine but now the code doesn't do anything. Any idea what is going on?

Sub CopyALLtoWord()
    Dim objWord As Object
    Dim objDoc As Object
    Dim i As Integer

    ActiveWindow.View = xlNormalView

    For i = 1 To ActiveWorkbook.Worksheets("1pager").Cells(3, 3)

        Worksheets("1pager").Range("n5").Value = i

        Range("N5").Select
        Calculate

        Application.Wait (Now + TimeValue("0:00:02"))

        ThisWorkbook.Worksheets("1pager").Range("L12:AL82").Select
        Selection.CopyPicture Appearance:=xlScreen, Format:=xlPicture

        'Select Word & paste


        Set objWord = GetObject(, "Word.Application")
        objWord.Selection.Paste

        objWord.Selection.TypeParagraph

        Application.CutCopyMode = False

    Next i

End Sub
0

There are 0 best solutions below