Office Automation

  • Thread starter Thread starter Vijay Chary
  • Start date Start date
V

Vijay Chary

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
 
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.
 

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

Back
Top