M
Mike NG
If I want to open word from excel using automation like this, is there
any way I can pass two variables across - the only way I can think of at
the moment is to use a file in between with the values in!
Sub OpenWord()
Dim oDoc As Word.Document
Dim oWord As Word.Application
'See if word's already running
On Error Resume Next
Set oWord = GetObject(, "Word.Application")
If Err Then
'No, so start a new word session
Set oWord = New Word.Application
Err.Clear
End If
oWord.Visible = True
oWord.Activate
Set oDoc = oWord.Documents.Open(ThisWorkbook.Path & "\Envelope.doc")
any way I can pass two variables across - the only way I can think of at
the moment is to use a file in between with the values in!
Sub OpenWord()
Dim oDoc As Word.Document
Dim oWord As Word.Application
'See if word's already running
On Error Resume Next
Set oWord = GetObject(, "Word.Application")
If Err Then
'No, so start a new word session
Set oWord = New Word.Application
Err.Clear
End If
oWord.Visible = True
oWord.Activate
Set oDoc = oWord.Documents.Open(ThisWorkbook.Path & "\Envelope.doc")