Running a VBA macro in Word 2010 to write to an Excel 2010 worksheet
Posted on 2013-11-08
I have a macro-enabled word 2010 document. I am trying to write to an Excel 2010 worksheet from this word doc.
What declaration are needed in the module in word 2010 for EXCEL to write to a excel 2010 worksheet?
I can write to an excel file by ANY name (don't care what it is) that will contain my destination worksheet
Dim obWord As Object
Dim doc As Word.Document
Dim docTable As Word.Table
Dim tblRow As Long, tblCol As Long
'Something is MISSING HERE
'Lines are needed here to write and excel file that contains the worksheet declared below
'Please remember that this will be running in Word 2010
Dim ws As Worksheet