ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Office Automation (https://www.excelbanter.com/excel-programming/411561-office-automation.html)

Vijay Chary

Office Automation
 
Hi !! :)

I need some information on controlling MS Word with a Macro in
MS Excel and vice-versa.

Could someone give me detailed instructions, please !! :)

Thanks in advance !


Vijay

[email protected]

Office Automation
 
On May 27, 10:36*am, Vijay Chary
wrote:
Hi !! :)

* * * * * * I need some information on controlling MS Word with a Macro in
MS Excel and vice-versa.

* * * * * Could someone give me detailed instructions, please !! :)

* * * * * *Thanks in advance !

* * * * * * * * * *Vijay


You don't say what you want either to do to the other, but

Dim WrdHold As String
Dim appwd As Object
On Error GoTo notloaded
Set appwd = GetObject(, "Word.Application")
notloaded:
If Err.Number = 429 Then
Set appwd = CreateObject("Word.Application")
End If
appwd.Visible = True
On Error GoTo 0


would give you a Word Object - you can then program this as with any
other object - for instance, to add a new document based on a
template

appwd.documents.Add Template:="Q:\APPS\StevApps\SystTemp\emulation
\Change of address.dot"

(this comes from a real word example). In the same way, you can
create an excel object and interface that.

Dick Kusleika[_4_]

Office Automation
 
On Tue, 27 May 2008 02:36:00 -0700, Vijay Chary
wrote:

Hi !! :)

I need some information on controlling MS Word with a Macro in
MS Excel and vice-versa.

http://www.dailydoseofexcel.com/arch...tomating-word/
--
Dick Kusleika
Microsoft MVP-Excel
http://www.dailydoseofexcel.com


All times are GMT +1. The time now is 11:15 PM.

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