Attribute VB_Name = "SERVICE"
Option Explicit
' -------------------------------------------------------------------------------------------------------
' Процедура делает невидимыми листы отчета
' EdiS\07.10.10\bugs-16042
' -------------------------------------------------------------------------------------------------------
Sub HideLists()
    On Error Resume Next
    With Application.ActiveWorkbook
        .Sheets("SQLData").Visible = xlVeryHidden
        .Sheets("Service").Visible = xlVeryHidden
        .Sheets("Form").Visible = xlVeryHidden
        .Sheets("Alg").Visible = xlVeryHidden
        .Sheets("Otbor_Cond").Visible = xlVeryHidden
        .Sheets("SEEK_POP_SQLDATA").Visible = xlVeryHidden
        .Sheets("SQLData1").Visible = xlVeryHidden
        .Sheets("Контроль").Visible = xlVeryHidden
        .Sheets("Расшифровка").Visible = xlVeryHidden
        .Sheets("SQLDATA2").Visible = False
    End With
    On Error GoTo 0
End Sub
' -------------------------------------------------------------------------------------------------------
' Процедура делает видимыми листы отчета
' EdiS\07.10.10\bugs-16042
' -------------------------------------------------------------------------------------------------------
Sub ShowLists()
    On Error Resume Next
    With Application.ActiveWorkbook
        .Sheets("SQLData").Visible = True
        .Sheets("Service").Visible = True
        .Sheets("Form").Visible = True
        .Sheets("Alg").Visible = True
        .Sheets("Otbor_Cond").Visible = True
        .Sheets("SEEK_POP_SQLDATA").Visible = True
        .Sheets("SQLData1").Visible = True
        .Sheets("Контроль").Visible = True
        .Sheets("Расшифровка").Visible = xlVeryHidden
    End With
    On Error GoTo 0
End Sub
' -------------------------------------------------------------------------------------------------------
' Процедура защиты отчета
' EdiS\07.10.10\bugs-16042
' -------------------------------------------------------------------------------------------------------
Sub Report_Protect()
Dim lcFileName As String
    lcFileName = Sheets("Service").Range("A26").Value
    With Workbooks(lcFileName + ".xlt").Sheets(Sheets("Service").Range("B19").Text)
        .Protect DrawingObjects:=False, Contents:=False, Scenarios:=False   'Временное снятие защиты
        .Activate
        .Cells(Sheets("Service").Range("C5"), Sheets("Service").Range("C6")).Select 'с какой колонки
        .Protect DrawingObjects:=False, Contents:=True, Scenarios:=False    'защита листа
        Application.ActiveWindow.DisplayHeadings = False
    End With
End Sub
' -------------------------------------------------------------------------------------------------------
' Процедура удаления панели инструментов
' EdiS\07.10.10\bugs-16042
' -------------------------------------------------------------------------------------------------------
Sub TOOLBAR_DELETE(lcName As String)
Dim Found As Boolean
Dim oBar As Object
    
    Found = False
    For Each oBar In Application.CommandBars
        If oBar.name = lcName Then Found = True
    Next
    If Found Then Application.CommandBars(lcName).Delete
End Sub
' -------------------------------------------------------------------------------------------------------
' Процедура удаления меню
' EdiS\07.10.10\bugs-16042
' -------------------------------------------------------------------------------------------------------
Sub MENU_DELETE()
Dim lcName As String
Dim Found As Boolean
Dim oBar As Object
    
    lcName = "Строка меню отчета"
    Found = False
    For Each oBar In Application.CommandBars
        If oBar.name = lcName Then Found = True
    Next
    If Found Then Application.CommandBars(lcName).Delete
    Application.CommandBars("Worksheet Menu Bar").Enabled = True
    Application.DisplayFormulaBar = True
    Application.CommandBars("Standard").Visible = True
End Sub
' -------------------------------------------------------------------------------------------------------
