View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
[email protected] aidan.heritage@virgin.net is offline
external usenet poster
 
Posts: 244
Default Getting Word to work with Excel

It would be greyed out if you were stepping through the macro?

However, you shouldn't need to add the reference - just use the
following code


Dim appwd As Object
On Error GoTo notloaded
Set appwd = GetObject(, "Word.Application")
notloaded:
If Err.Number = 429 Then
Set appwd = CreateObject("Word.Application")
'if not adding a new document in your process, add it now
as this
'method would give an instance of Word WITHOUT a doc!
End If
appwd.Visible = True
On Error GoTo 0
With appwd
'do what you want
end with

wrote:
Oops, sorry for the double-post...anyway, if it helps, I'm using
Microsoft Office Word/Excel SP2, with Visual Basic 6.3.

wrote:
Hi all,
I'm trying to use VBA to coordinate Word and Excel. I know that to
do so, you need to configure something under Tools-References.
Unfortunately, when I look under the Tools menu, References is grayed
out--does anyone know why this might be, and what I'd have to do to
enable it?

Thanks,
Mike