ник: час
Public xlaProd As Excel.Application
Public WrkBk As Excel.Workbook
Public WrkSht As Excel.Worksheet
Dim rngActive As Range, rngInput As Range
Dim row As Integer ' НОМЕР СТРОКИ
Dim col As Integer ' НОМЕР КОЛОНКИ
Public Function CreateSheet(VIHODNOJ_DOKUMENT As String, VHODNOJ_DOKUMENT As String, PUT_OTCHOTA)
Set WrkBk = CreateObject("Excel.Sheet")
Set xlaProd = WrkBk.Parent
If Dir(CurrentPath & "\Лого.bmp") <> "" Then
WrkBk.ActiveSheet.Pictures.Insert(CurrentPath & "\Лого.bmp").Select
Else
MsgBox "Рисунок отсутствует " & CurrentPath & "\Лого.bmp"
End If
If VHODNOJ_DOKUMENT = "Отчёт за месяц" Then ZA_MESAC
WrkBk.SaveAs (PUT_OTCHOTA & "\" & VIHODNOJ_DOKUMENT)
WrkBk.Close
xlaProd.Quit
If Dir(PUT_OTCHOTA & "\" & VIHODNOJ_DOKUMENT, vbDirectory) <> "" Then
MsgBox "Создан отчёт " & PUT_OTCHOTA & "\" & VIHODNOJ_DOKUMENT
Else
Call MsgBox("Документ " & VIHODNOJ_DOKUMENT & " не создан ", vbCritical)
End If
Set rngInput = Nothing
Set rngActive = Nothing
Set WrkSht = Nothing
Set WrkBk = Nothing
Set xlaProd = Nothing
End Function
ВСЕМ спасибо!!!