ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Exporting weekly data from different sheets to a word document (https://www.excelbanter.com/excel-programming/431132-exporting-weekly-data-different-sheets-word-document.html)

jfp

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




ryguy7272

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




jfp

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





All times are GMT +1. The time now is 01:20 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com