Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.word.vba.general,microsoft.public.excel.programming,microsoft.public.excel.misc,microsoft.public.word.vba.userforms
|
|||
|
|||
![]()
Hi-
I am new to VBA. I am making an automated report by copying excel tables and pasting them in word. I want to use word VBA instead of excel. I can get the tables to paste into word, but I can not get them to be linked, so that when a parameter changes in excel it automatically updates in my word document. The PasteExcelTable command isn't working and I have the LinkedToExcel = true. I pasted my code below. I am also having difficulty getting the excel table to paste into the right document. I tried running the code in a module in the document and also running the code in the document itself. But if another word document is open, it sometimes pastes the table in the other document. Can someone please help me!! Thank you in advance- Sarah Sub MissionDesignTemplate() Dim xlApp As Excel.Application Dim xlBook As Excel.Workbook Dim strLVParameters As String Set xlApp = CreateObject("Excel.Application") Set xlBook = xlApp.Workbooks.Open("C:\Documents and Settings\shornbec\Desktop\sarah\excel templates\Mission.FY07Q1_Sarah.xls") xlBook.Sheets("Report Tables").Range("LVParameters").Copy Selection.PasteExcelTable LinkedToExcel:=True, WordFormatting:=False, RTF:=False xlBook.Close xlApp.Quit Set xlBook = Nothing Set xlApp = Nothing End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Create a Word Table from a Excel Macro | Excel Discussion (Misc queries) | |||
Macro to Extract Text From Word Table Into Excel? | Excel Discussion (Misc queries) | |||
Paste Table from Word in Excel - 2000 -vs- 2002 | Excel Discussion (Misc queries) | |||
Extract MS Excel Data embedded in MS Word | Excel Discussion (Misc queries) | |||
TRYING TO SET UP EXCEL SPREADSHEET ON MY COMPUTER | New Users to Excel |