ник: Дядя Федор
Убей объект экселя
.quit
Public Sub tst2()
Dim ExcelApplication As Excel.Application
Dim WrkBk As Excel.Workbook
Dim mypath$
mypath = Application.CurrentProject.Path & "\book2.XLS"
Set ExcelApplication = CreateObject("Excel.Application")
With ExcelApplication
Set WrkBk = .Workbooks.Open(mypath) 'fileXLT
WrkBk.Sheets(2).Name = "111" 'Это для примера
End With
WrkBk.Save
ExcelApplication.Quit
Set WrkBk = Nothing
Set ExcelApplication = Nothing
End Sub
|
Проверил. Вроде работает.