Link to home
Start Free TrialLog in
Avatar of Matt Jones
Matt JonesFlag for United States of America

asked on

Running a VBA macro in Word 2010 to write to an Excel 2010 worksheet

Hi,

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
ASKER CERTIFIED SOLUTION
Avatar of GrahamSkan
GrahamSkan
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial