Public
Sub SummeausExcel()
On Error GoTo FehlerSub
Dim appXL As Excel.Application
Set appXL = GetObject(, "Excel.Application")
appXL.workbooks.Open (ActiveDocument.Path & "\werte.xls")
ActiveDocument.Bookmarks("Betrag").Select
Selection.InsertAfter appXL.ActiveSheet.Range("C14")
appXL.Quit
Set appXL = Nothing
Exit Sub
FehlerSub:
If Err = 429 Then
Set appXL = GetObjekt("", "Excel.Application")
Else
Err.Raise Err.Number
End If
Resume Next
End Sub
Beide Dateien befinden sich im gleichen ordner - makro will nicht funktionieren. :(