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
Create a Word Table from a Excel Macro Silvia Excel Discussion (Misc queries) 0 September 7th 06 12:34 AM
Macro to Extract Text From Word Table Into Excel? V. Hatherley Excel Discussion (Misc queries) 1 August 27th 06 04:12 PM
Paste Table from Word in Excel - 2000 -vs- 2002 PeteW Excel Discussion (Misc queries) 3 April 27th 06 07:36 AM
Extract MS Excel Data embedded in MS Word qualityprocess Excel Discussion (Misc queries) 0 April 20th 06 05:52 PM
TRYING TO SET UP EXCEL SPREADSHEET ON MY COMPUTER MEGTOM New Users to Excel 5 October 27th 05 03:06 AM


All times are GMT +1. The time now is 06:41 PM.

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"