Call Excel VBA from Word VBA? 
Author Message
 Call Excel VBA from Word VBA?

VBers,

What's the recommended way to call from a Word VBA procedure to an Excel
VBA procedure?  Is this done by some particular syntax like:

file.project.procedure args

or is it done by first getting an Automation connection from Word to
Excel, and then doing something like:

ExcelApp.RunSomeProc procname

Can't seem to find any docs on this, or at least don't know what to look
it up by.

TIA,

Graham

-----------------------------------
Graham Wideman

(Remove the obvious to email me)
-----------------------------------



Tue, 12 Nov 2002 03:00:00 GMT  
 Call Excel VBA from Word VBA?
Hi Graham,

First you would need to Automate Excel and open the Workbook; then you could
call the Run method of the Excel.Application object to run the specified
Excel VBA routine.  You can pass arguments to the routine through arguments
of the Run method, and the Run method returns whatever is returned by the
routine you're calling.  The Run method is explained in more detail in the
Excel VB help file.

Regards,
Jake Marx



Quote:
> VBers,

> What's the recommended way to call from a Word VBA procedure to an Excel
> VBA procedure?  Is this done by some particular syntax like:

> file.project.procedure args

> or is it done by first getting an Automation connection from Word to
> Excel, and then doing something like:

> ExcelApp.RunSomeProc procname

> Can't seem to find any docs on this, or at least don't know what to look
> it up by.

> TIA,

> Graham

> -----------------------------------
> Graham Wideman

> (Remove the obvious to email me)
> -----------------------------------



Tue, 12 Nov 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Access VBA Calling MSWord/Excel VBA?

2. VBA coding to call an Excel VBA macro from Outlook

3. Word VBA vs Excel VBA

4. VBA Excel-calling word

5. Windows EXCEL VBA / MAC EXCEL VBA compatibility issues

6. Excel 97 VBA vs Excel 2000 VBA

7. WSH calls VBA or VBA calls WSH

8. VBA Analysis Tookpack- Excel In Access VBA

9. vba access vs vba excel (alguien sabe?)

10. NEW VBA'er(Excel) looking for other VBA'ers

11. Excel/VBA graphics: Settings X-axis scale properties in VBA

12. Access97 VBA and Word VBA

 

 
Powered by phpBB® Forum Software