runtime error wenn macro im protecded mode startet

Bild

Betrifft: runtime error wenn macro im protecded mode startet
von: runtime error wenn macro im protecded mode startet
Geschrieben am: 25.11.2003 18:38:22

Hallo zusammen

ich hab ein macro geschrieben, welcher von einem sheet per schaltflächenklick auf ein anderes sheet im selben file führt. wenn ich aber nun die sheet passwortshütze funktioniert das macro nicht mehr. kann mir einer helfen??

anbei der code:
-----------------------------------


Sub ManpowerReportInHours()
'
' Macro2 Macro
' Macro recorded 15.11.2003 by DNP Kaiseraugst
'
Dim yr As Integer
Dim mth As String
Sheets("ICT Project Manpower").Select
Columns("A:BD").Select
Selection.EntireColumn.Hidden = True
Columns("A:B").Select
Selection.EntireColumn.Hidden = False
Columns("F:J").Select
Selection.EntireColumn.Hidden = False
mth = Worksheets("Workflow Mthly Reporting").Range("$C$6")
yr = Worksheets("Workflow Mthly Reporting").Range("$E$6")
Select Case yr  ' Evaluate yr.
Case 2004 ' yr 2004
    Columns("W:W").Select
    Selection.EntireColumn.Hidden = False
    Columns("AJ:AJ").Select
    Selection.EntireColumn.Hidden = False
    Columns("AW:BD").Select
    Selection.EntireColumn.Hidden = False
    Select Case mth 'Monat
    Case "JAN", "FEB", "MAR"
        Columns("K:M").Select
        Selection.EntireColumn.Hidden = False
    Case "APR", "MAY", "JUN"
        Columns("N:P").Select
        Selection.EntireColumn.Hidden = False
    Case "JUL", "AUG", "SEP"
        Columns("Q:S").Select
        Selection.EntireColumn.Hidden = False
    Case "OCT", "NOV", "DEC"
        Columns("T:V").Select
        Selection.EntireColumn.Hidden = False
    End Select
Case 2005    ' yr 2005
    Columns("W:W").Select
    Selection.EntireColumn.Hidden = False
    Columns("AJ:AJ").Select
    Selection.EntireColumn.Hidden = False
    Columns("AW:BD").Select
    Selection.EntireColumn.Hidden = False
    Select Case mth 'Monat
    Case "JAN", "FEB", "MAR"
        Columns("X:Z").Select
        Selection.EntireColumn.Hidden = False
    Case "APR", "MAY", "JUN"
        Columns("AA:AC").Select
        Selection.EntireColumn.Hidden = False
    Case "JUL", "AUG", "SEP"
        Columns("AD:AF").Select
        Selection.EntireColumn.Hidden = False
    Case "OCT", "NOV", "DEC"
        Columns("AG:AI").Select
        Selection.EntireColumn.Hidden = False
    End Select
Case 2006 ' yr 2006
    Columns("W:W").Select
    Selection.EntireColumn.Hidden = False
    Columns("AJ:AJ").Select
    Selection.EntireColumn.Hidden = False
    Columns("AW:BD").Select
    Selection.EntireColumn.Hidden = False
    Select Case mth 'Monat
    Case "JAN", "FEB", "MAR"
        Columns("AK:AM").Select
        Selection.EntireColumn.Hidden = False
    Case "APR", "MAY", "JUN"
        Columns("AN:AP").Select
        Selection.EntireColumn.Hidden = False
    Case "JUL", "AUG", "SEP"
        Columns("AQ:AS").Select
        Selection.EntireColumn.Hidden = False
    Case "OCT", "NOV", "DEC"
        Columns("AT:AV").Select
        Selection.EntireColumn.Hidden = False
    End Select
Case Else   ' Other values.
End Select
End Sub


Sub CostReportInBudCurr()
'
' Macro2 Macro
' Macro recorded 15.11.2003 by DNP Kaiseraugst
'
Dim yr As Integer
Dim mth As String
Sheets("ICT Project Cost").Select
Columns("A:BD").Select
Selection.EntireColumn.Hidden = True
Columns("A:A").Select
Selection.EntireColumn.Hidden = False
Columns("F:J").Select
Selection.EntireColumn.Hidden = False
mth = Worksheets("Workflow Mthly Reporting").Range("$C$6")
yr = Worksheets("Workflow Mthly Reporting").Range("$E$6")
Select Case yr  ' Evaluate yr.
Case 2004 ' yr 2004
    Columns("W:W").Select
    Selection.EntireColumn.Hidden = False
    Columns("AJ:AJ").Select
    Selection.EntireColumn.Hidden = False
    Columns("AW:BD").Select
    Selection.EntireColumn.Hidden = False
    Select Case mth 'Monat
    Case "JAN", "FEB", "MAR"
        Columns("K:M").Select
        Selection.EntireColumn.Hidden = False
    Case "APR", "MAY", "JUN"
        Columns("N:P").Select
        Selection.EntireColumn.Hidden = False
    Case "JUL", "AUG", "SEP"
        Columns("Q:S").Select
        Selection.EntireColumn.Hidden = False
    Case "OCT", "NOV", "DEC"
        Columns("T:V").Select
        Selection.EntireColumn.Hidden = False
    End Select
Case 2005    ' yr 2005
    Columns("W:W").Select
    Selection.EntireColumn.Hidden = False
    Columns("AJ:AJ").Select
    Selection.EntireColumn.Hidden = False
    Columns("AW:BD").Select
    Selection.EntireColumn.Hidden = False
    Select Case mth 'Monat
    Case "JAN", "FEB", "MAR"
        Columns("X:Z").Select
        Selection.EntireColumn.Hidden = False
    Case "APR", "MAY", "JUN"
        Columns("AA:AC").Select
        Selection.EntireColumn.Hidden = False
    Case "JUL", "AUG", "SEP"
        Columns("AD:AF").Select
        Selection.EntireColumn.Hidden = False
    Case "OCT", "NOV", "DEC"
        Columns("AG:AI").Select
        Selection.EntireColumn.Hidden = False
    End Select
Case 2006 ' yr 2006
    Columns("W:W").Select
    Selection.EntireColumn.Hidden = False
    Columns("AJ:AJ").Select
    Selection.EntireColumn.Hidden = False
    Columns("AW:BD").Select
    Selection.EntireColumn.Hidden = False
    Select Case mth 'Monat
    Case "JAN", "FEB", "MAR"
        Columns("AK:AM").Select
        Selection.EntireColumn.Hidden = False
    Case "APR", "MAY", "JUN"
        Columns("AN:AP").Select
        Selection.EntireColumn.Hidden = False
    Case "JUL", "AUG", "SEP"
        Columns("AQ:AS").Select
        Selection.EntireColumn.Hidden = False
    Case "OCT", "NOV", "DEC"
        Columns("AT:AV").Select
        Selection.EntireColumn.Hidden = False
    End Select
Case Else   ' Other values.
End Select
End Sub


Sub Input_MP_Budget_in_hrs()
'
' Input_MP_Budget_in_hrs Macro
' Macro recorded 02.11.2003 by DNP Kaiseraugst
Sheets("ICT Project Manpower").Select
Columns("A:H").Select
Selection.EntireColumn.Hidden = False
Columns("I:BD").Select
Selection.EntireColumn.Hidden = True
End Sub


Sub Input_Cost_Budget_loc_Curr()
'
' Input_Cost_Budget_loc_Curr Macro
' Macro recorded 02.11.2003 by DNP Kaiseraugst
Sheets("ICT Project Cost").Select
Columns("A:A").Select
Selection.EntireColumn.Hidden = False
Columns("B:B").Select
Selection.EntireColumn.Hidden = True
Columns("C:H").Select
Selection.EntireColumn.Hidden = False
Columns("I:BD").Select
Selection.EntireColumn.Hidden = True
End Sub


Sub Input_Prj_MasterData()
'
' Input_Prj_MasterData Macro
' Macro recorded 02.11.2003 by DNP Kaiseraugst
'
'
    ActiveWorkbook.CustomViews("Prj Master Data").Show
End Sub


--------------------

danke und gruss

dreale
Bild


Betrifft: AW: runtime error wenn macro im protecded mode startet
von: GerdW
Geschrieben am: 25.11.2003 19:46:05

Sheets("ICT Project Manpower").Select
activesheet.unprotect Password:="xxx"

dein code....

Sheets("ICT Project Manpower").protect password:="xxx"

Gerd


Bild

Beiträge aus den Excel-Beispielen zum Thema " Diagramm !!!!!!!!"