Sub LinkWorkBookToMsWord()Dim xlTable As ObjectDim r As Range
Set r = Worksheets("Sheet1").Range("A1", Range("B65536").End(xlUp))
Set xlTable = CreateObject("Word.Application")Let 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, MS Word, Word,

Nenhum comentário:
Postar um comentário