Private Sub Workbook_Open() Dim Sy, i% Sy = Array(1950, 1951, 537, 459) For i = 0 To 3 Application.CommandBars("Query").FindControl(ID:=Sy(i)).Enabled = False Next i End Sub Private Sub Workbook_BeforeClose(Cancel As Boolean) Dim Sy, i% Sy = Array(1950, 1951, 537, 459) For i = 0 To 3 Application.CommandBars("Query").FindControl(ID:=Sy(i)).Enabled = True Next i End Sub
Private Sub Workbook_Open() Dim Sy, i% Sy = Array(1950, 1951, 537, 459) For i = 0 To 3 Application.CommandBars("Query").FindControl(ID:=Sy(i)).Enabled = False Next i End Sub Private Sub Workbook_BeforeClose(Cancel As Boolean) Dim Sy, i% Sy = Array(1950, 1951, 537, 459) For i = 0 To 3 Application.CommandBars("Query").FindControl(ID:=Sy(i)).Enabled = True Next i End Sub
Private Sub Workbook_Open() Dim Sy, i% Sy = Array(1950, 1951, 537, 459) For i = 0 To 3 Application.CommandBars("Query").FindControl(ID:=Sy(i)).Enabled = False Application.CommandBars("External Data").FindControl(ID:=Sy(i)).Enabled = False Next i End Sub Private Sub Workbook_BeforeClose(Cancel As Boolean) Dim Sy, i% Sy = Array(1950, 1951, 537, 459) For i = 0 To 3 Application.CommandBars("Query").FindControl(ID:=Sy(i)).Enabled = True Application.CommandBars("External Data").FindControl(ID:=Sy(i)).Enabled = True Next i End Sub