لا أعلم ماهي المشكلة
هل هي في محتوى الـThisWorkbook الخاص بي... هذا محتواه:
Const Warning As String = "Warning"
Private Sub Workbook_Open()
Dim Ws As Worksheet
Application.ScreenUpdating = False
For Each Ws In ThisWorkbook.Worksheets
Ws.Visible = xlSheetVisible
Next Ws
Sheets(Warning).Visible = xlVeryHidden
Application.ScreenUpdating = True
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim Ws As Worksheet
Application.ScreenUpdating = False
Sheets(Warning).Visible = xlSheetVisible
For Each Ws In ThisWorkbook.Worksheets
If Ws.Name <> Warning Then
Ws.Visible = xlVeryHidden
End If
Next Ws
Application.ScreenUpdating = True
ActiveWorkbook.Save
End Sub
Private Sub Workbook_Open()
ActiveWindow.DisplayHeadings = False
Application.DisplayFormulaBar = False
Application.ExecuteExcel4Macro "SHOW.TOOLBAR(""Ribbon"",false)"
GetSheets
VisibleFalse
Showme
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
ActiveWindow.DisplayHeadings = True
Application.DisplayFormulaBar = True
Application.ExecuteExcel4Macro "SHOW.TOOLBAR(""Ribbon"",TRUE)"
ThisWorkbook.Save
End Sub
أم في المودل، وهذا محتواه:
Sub Showme()
Application.Visible = False
frmLogin.Show
End Sub
Sub Toggle()
ActiveWindow.DisplayWorkbookTabs = Not ActiveWindow.DisplayWorkbookTabs
End Sub
Sub GetSheets()
'add the sheet names to the sheet
Sheet2.Range("Q8:Q108").ClearContents
Dim i As Integer
For i = 1 To Sheets.Count
Sheet2.Range("Q" & i + 7) = Sheets(i).Name
Next i
End Sub
Sub VisibleTrue()
Dim Ws As Worksheet
For Each Ws In ActiveWorkbook.Sheets
Ws.Visible = True
Next Ws
ActiveWindow.DisplayWorkbookTabs = True
Sheet1.Select
End Sub
Sub VisibleFalse()
Dim Ws As Worksheet
GetSheets
'loop through each sheet
For Each Ws In Worksheets
'use the case statement to exclude sheets by sheet name
Select Case Ws.Name
'add the name of the sheets to exclude
Case "Interface"
'Case "Login"
'protect the rest
Case Else
Ws.Visible = xlVeryHidden
End Select
Next Ws
End Sub
تكرموا مشكورين بمساعدتي وجزاكم الله كل خير