mit diesem Code übertrage ich Daten in einen Laufwerk
Private Sub Cmd_Speichern_Click()
Dim crt As Control
Dim intCol As Integer
Dim lngDatum As Long
lngDatum = CDate(TextBox2_Datum)
Application.ScreenUpdating = False
Workbooks.Open Filename:="L:\Transfer\Allgemein\\Mitarbeiterzusammenfassung.xlsm"
With Workbooks("Mitarbeiterzusammenfassung.xlsm").Sheets("2016")
If Not IsError(Application.Match(lngDatum, .Rows(1), 0)) Then
intCol = Application.Match(lngDatum, .Rows(1), 0)
.Cells(2, intCol).Value = TextBox1_User.Value
.Cells(3, intCol).Value = TextBox4_ST.Value
.Cells(4, intCol).Value = Format(CDate(TextBox3_Zeit.Value), "hh:mm")
.Cells(5, intCol).Value = TextBox5_Auf.Value
.Cells(6, intCol).Value = TextBox6_Krank.Value
.Cells(7, intCol).Value = TextBox7_Urlaub.Value
.Cells(8, intCol).Value = TextBox8_NT.Value
.Cells(9, intCol).Value = TextBox9_Nach.Value
.Cells(10, intCol).Value = TextBox10_Waren.Value
.Cells(11, intCol).Value = TextBox11_WE.Value
Else
MsgBox "falsches Datum"
Workbooks("Mitarbeiterzusammenfassung.xlsm").Close
With TextBox2_Datum
.SetFocus
.SelStart = 0
.SelLength = Len(.Text)
End With
Exit Sub
End If
End With
MsgBox "Eintragung erfolgreich"
With Workbooks("Mitarbeiterzusammenfassung.xlsm")
.Save
.Close
End With
Application.ScreenUpdating = True
For Each crt In Me.Controls
Select Case TypeName(crt)
Case "TextBox"
crt.Value = ""
Case Else
End Select
Next
End Sub
mein Problem ist das die Datei mitarbeiter Zusammenfassung.xlsm eigentlich passwort geschützt sein soll. Damit keiner diese Datei öffnen kann.Wie kann ich den vba Code anpassen das nach dem übertragen das Passwort: 1234 wieder anlegt das keiner hineinschauen kann.
Danke
maria