View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Jim Cone[_2_] Jim Cone[_2_] is offline
external usenet poster
 
Posts: 1,549
Default Test if Word is running

Couple of suggestions...
Use Option Explicit as a single line at the top of the module.
Qualify all objects with the appropriate parent object.
(both Word and Excel have a range object)...

Dim RngColA As Excel.Range
Set MySht = ThisWorkbook.Sheets("Sheet1")
Set RngColA = MySht.Range("A2", MySht.Range("A" & MySht.Rows.Count).End(xlUp))
...all objects
--
Jim Cone
Portland, Oregon USA




"John"
wrote in message
Nevermind...found a solution.

On Error Resume Next
Set oWord = GetObject(, "Word.Application")
If Err Then
Else
MsgBox ("Stop")
End
End If

Credit goes to http://www.word.mvps.org/FAQs/InterD...XLFromWord.htm