Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Exporting weekly data from different sheets to a word document
Hi there,
I populate excel sheets with weekly data to gather a series of info over a period of time. I then send some of the weekly info off in a word document which reviews some of the info (and so only pick certain bits of the info). The word document is the same every week - I am looking for a solution which takes the latest data from the spreadsheet to the word file with the corresponding date. Can I direct certain cells to the relevant table in the word file? Does that make sense? Thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Exporting weekly data from different sheets to a word document
Here is one option:
http://www.erlandsendata.no/english/...olecontrolword Take a look at this: http://word.mvps.org/FAQs/InterDev/C...WordFromXL.htm This too: http://addbalance.com/usersguide/fields.htm And this: http://gregmaxey.mvps.org/Word_Fields.htm Finally, once you get the DocVariable fields set up in Word (hit Alt + F9 to see all fields), run this code from Excel. Sub PushToWord() Dim objWord As New Word.Application Dim doc As Word.Document Dim bkmk As Word.Bookmark sWdFileName = Application.GetOpenFilename(, , , , False) Set doc = objWord.Documents.Open(sWdFileName) With doc ..Variables("VarNumber1").Value = Range("VarNumber1").Value ..Variables("VarNumber2").Value = Range("VarNumber2").Value 'etc ..Range.Fields.Update End With 'ActiveDocument.Fields.Update objWord.Visible = True End Sub Note: This code runs in Excel; pushes Excel variables (assigned as Named Ranges) to Word. Make sure you set a Reference to Word, under Tools References. HTH, Ryan--- -- Ryan--- If this information was helpful, please indicate this by clicking ''Yes''. "jfp" wrote: Hi there, I populate excel sheets with weekly data to gather a series of info over a period of time. I then send some of the weekly info off in a word document which reviews some of the info (and so only pick certain bits of the info). The word document is the same every week - I am looking for a solution which takes the latest data from the spreadsheet to the word file with the corresponding date. Can I direct certain cells to the relevant table in the word file? Does that make sense? Thanks |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Exporting weekly data from different sheets to a word document
Thank you for such a quick response.
No doubt one of those solutions will sort me out. Am off to look them up. Many thanks again. "ryguy7272" wrote: Here is one option: http://www.erlandsendata.no/english/...olecontrolword Take a look at this: http://word.mvps.org/FAQs/InterDev/C...WordFromXL.htm This too: http://addbalance.com/usersguide/fields.htm And this: http://gregmaxey.mvps.org/Word_Fields.htm Finally, once you get the DocVariable fields set up in Word (hit Alt + F9 to see all fields), run this code from Excel. Sub PushToWord() Dim objWord As New Word.Application Dim doc As Word.Document Dim bkmk As Word.Bookmark sWdFileName = Application.GetOpenFilename(, , , , False) Set doc = objWord.Documents.Open(sWdFileName) With doc .Variables("VarNumber1").Value = Range("VarNumber1").Value .Variables("VarNumber2").Value = Range("VarNumber2").Value 'etc .Range.Fields.Update End With 'ActiveDocument.Fields.Update objWord.Visible = True End Sub Note: This code runs in Excel; pushes Excel variables (assigned as Named Ranges) to Word. Make sure you set a Reference to Word, under Tools References. HTH, Ryan--- -- Ryan--- If this information was helpful, please indicate this by clicking ''Yes''. "jfp" wrote: Hi there, I populate excel sheets with weekly data to gather a series of info over a period of time. I then send some of the weekly info off in a word document which reviews some of the info (and so only pick certain bits of the info). The word document is the same every week - I am looking for a solution which takes the latest data from the spreadsheet to the word file with the corresponding date. Can I direct certain cells to the relevant table in the word file? Does that make sense? Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Exporting excel cell contents to word document | Excel Programming | |||
Exporting multiple cell contents into word document | Excel Worksheet Functions | |||
exporting data to appear at Bookmarks in a Word Document | Excel Programming | |||
Exporting VBA DataForm Info to Word document | Excel Programming | |||
Exporting text to a Word document | Excel Programming |