Este código colará a partir de um intervalo do MS Excel num documento do MS Word, deixando-o interligado ao MS Excel.
Sub LinkWorkBookToMsWord()Dim xlTable As ObjectDim r As RangeSet r = Worksheets("Sheet1").Range("A1", Range("B65536").End(xlUp))Set xlTable = CreateObject("Word.Application")xlTable.Visible = Truer.CopyxlTable.documents.AddxlTable.Selection.PasteSpecial Link:=True, DataType:=wdPasteOLEObject, Placement:= _wdInLine, DisplayAsIcon:=FalsexlTable.activedocument.SaveAs ThisWorkbook.Path & "/" & "LinkedToWord.doc"xlTable.documents.ClosexlTable.QuitApplication.CutCopyMode = FalseEnd Sub
Tags: Excel, VBA, copy, paste,
