read excel from word

M

mcnewsxp

i would like to read from some cells in excel worksheet and update an
existing table within a word doc with those values using VBA. the VBA
can live anywhere but the excel file.
can anyone provide an example?
tia,
mcnewsxp
 
J

Jay Freedman

i would like to read from some cells in excel worksheet and update an
existing table within a word doc with those values using VBA. the VBA
can live anywhere but the excel file.
can anyone provide an example?
tia,
mcnewsxp

See http://www.word.mvps.org/FAQs/InterDev/ControlXLFromWord.htm

If that isn't enough, post back with more details, such as how to
locate the right cells and how to locate the right table, so the
sample will be useful.
 
M

mcnewsxp

Seehttp://www.word.mvps.org/FAQs/InterDev/ControlXLFromWord.htm

If that isn't enough, post back with more details, such as how to
locate the right cells and how to locate the right table, so the
sample will be useful.

--
Regards,
Jay Freedman
Microsoft Word MVP        FAQ:http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroupso all may benefit.

that's a great start. i think i can figure out how to locate the
right table and cell, but if you have some sippets handy that'd be
even better!
thanks much!
 
M

mcnewsxp

Seehttp://www.word.mvps.org/FAQs/InterDev/ControlXLFromWord.htm

If that isn't enough, post back with more details, such as how to
locate the right cells and how to locate the right table, so the
sample will be useful.

--
Regards,
Jay Freedman
Microsoft Word MVP        FAQ:http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroupso all may benefit.

got it.

Public Sub FillTable(ByVal iRow As Integer, ByVal iCol As Integer,
ByVal sValue As String)


ActiveDocument.Range.Tables(3).Cell(iRow, iCol).Range.Text =
sValue


End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top