[b]xlApp.DisplayAlerts = False[/b]
Call xlApp.Workbooks(1).SaveAs( filePathExcel )
Call grDoc.RemoveItem("anBody")
Set rtNew = grDoc.CreateRichTextItem("anBody")
Call rtNew.EmbedObject(EMBED_ATTACHMENT, "", filePathExcel)
If Not grDoc.IsUIDocOpen Then
Call grDoc.Save(False, False)
Else
Print Cstr(count) & ": Документ не сохранен: " & clientNameForError
End If
............
' Закрытие листа
On Error Goto errApp
If Not xlApp.Workbooks Is Nothing Then
xlApp.DisplayAlerts = False
xlApp.Workbooks(1).Close False
End If
............
' =========================================
' По окончании работы с Ехсел-ем
If Not Isempty(xlApp) Then
[b]xlApp.DisplayAlerts = False[/b]
If Not xlApp.ActiveWorkbook Is Nothing Then
xlApp.Workbooks(1).Close False
Print " ===== closed books with error mode ===== "
End If
xlApp.Quit
End If