LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.word.vba.general,microsoft.public.excel.programming,microsoft.public.excel.misc,microsoft.public.word.vba.userforms
external usenet poster
 
Posts: 6
Default Link table from excel to word using word VBA

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
can I link my Excel Cells to a table in a Word Document Dr. Darrell Excel Discussion (Misc queries) 5 August 31st 09 07:31 PM
Link Excel S/Sheet cells to Table in Word document Chris Gorham Excel Discussion (Misc queries) 2 January 20th 08 08:13 PM
Link table from excel to word using word VBA [email protected] Excel Discussion (Misc queries) 7 January 9th 07 05:57 PM
How do I link excel to word so excel changes appear in word? caliskier Excel Discussion (Misc queries) 2 August 31st 05 05:23 PM
how do i link a word to a colour so everytime i type the word gre. NRG_eyes Excel Discussion (Misc queries) 1 December 1st 04 10:41 PM


All times are GMT +1. The time now is 01:52 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"