Sub IntoExcelThroughWord() 'with reference MS Word 15.0 Object Library & MS Forms 2.0 Object Library
Dim fNm$, oWrd As Word.Application
Dim oData As DataObject
fNm = Application.GetOpenFilename(FileFilter:="PDF Files (*.pdf), *.pdf", MultiSelect:=False)
If fNm = "False" Then Exit Sub
Application.ScreenUpdating = False
Sheets("Sheet1").UsedRange.ClearContents
Set oWrd = New Word.Application
Set oData = New DataObject
With oWrd.Documents.Open(fNm, ConfirmConversions:=False)
DoEvents
.Range.Copy
Sheets("Sheet1").Range("A1").PasteSpecial xlPasteValues
oData.SetText ""
oData.PutInClipboard
.Close 0
End With
oWrd.Quit
Set oWrd = Nothing
Application.ScreenUpdating = True
MsgBox "Ok", 64
End Sub
|