Welcome to FreeSoftwareServers Confluence Wiki

Open a new Doc, type some text and select to test.

Sub CopyToNewExcelWBFromDoc()

Dim objWord As Object    'Word.Application
Set objWord = GetObject(, "Word.Application")
objWord.Selection.Copy ' Select text from Word Doc

Dim objExcel As Object, objWB As Object
Set objExcel = CreateObject("Excel.Application")
Set objWB = objExcel.Workbooks.Add
objExcel.Visible = True

'Paste into new workbook
Set wb = objExcel.ActiveWorkbook
Set ws = wb.Worksheets("Sheet1")

With ws
End With

End Sub
  • No labels