Could not get the Word App to quit without the "Large amount of data in clipboard" dialog and Word has no way to avoid it, so sendkeys seemed the easy way out ...
Anyone know a more elegant method?
Sub Word_to_Excel()
'
Dim wApp As Word.Application, gdoc As String
'
Set wApp = CreateObject("Word.Application")
'
gdoc = Application.GetOpenFilename("Word Files (*.doc*)," & "*doc*")
wApp.Visible = True
wApp.Documents.Open (gdoc)
wApp.Selection.WholeStory
wApp.Selection.Copy
Range("A1").Activate
wApp.Documents(1).Close
wApp.Quit
AppActivate wApp
Application.SendKeys ("{ENTER}")
Set wApp = Nothing
'
End Sub
Anyone know a more elegant method?
Sub Word_to_Excel()
'
Dim wApp As Word.Application, gdoc As String
'
Set wApp = CreateObject("Word.Application")
'
gdoc = Application.GetOpenFilename("Word Files (*.doc*)," & "*doc*")
wApp.Visible = True
wApp.Documents.Open (gdoc)
wApp.Selection.WholeStory
wApp.Selection.Copy
Range("A1").Activate
wApp.Documents(1).Close
wApp.Quit
AppActivate wApp
Application.SendKeys ("{ENTER}")
Set wApp = Nothing
'
End Sub