ist es möglich über ein Makro einen in Excel markierten
Tabellenbereich in Word als "Unformatierten Text" einzufügen.
Schiane Griaß
Andreas
Sub KopiereSelection()
Dim rg As Range
Set rg = Application.Selection
If rg Is Nothing Then
MsgBox "..."
Exit Sub
End If
rg.Copy
Set rg = Nothing
Dim oApp As Word.Application
Set oApp = GetApplication("Word.Application")
If oApp Is Nothing Then
MsgBox "..."
Exit Sub
End If
Dim oDoc As Word.Document
Set oDoc = oApp.Documents.Add
oApp.Selection.PasteAndFormat wdFormatPlainText
Set oDoc = Nothing
Set oApp = = Nothing
End Sub
Function GetApplication(ByVal AppClass As String) As Object
Const vbErr_AppNotRun = 429
On Error Resume Next
Set GetApplication = GetObject(Class:=AppClass)
If Err.Number = vbErr_AppNotRun _
Then Set GetApplication = CreateObject(AppClass)
On Error GoTo 0
End Function