Laufzeitfehler '-2147352573 (80020003)'
21.07.2004 11:47:19
Michael
ich stehe vor einem riesigen Problem! Ich habe ein Art Programm in Excel gebastelt, welches eigentlich ganz gut funktioniert hat. Jetzt habe ich daran ein bißchen rumgebastelt und versucht das "Tool" zu verbessern und zu erweitern. ==> Das ist mir leider nicht gelungen. Jetzt kommt immer, wenn ich auf einen bestimmten Button in einer UserForm klicke, welcher auf eine andere UForm verweist den oben genannten Laufzeitfehler!!! Dabei drehe ich noch durch... ich weiß nicht, wie ich das wieder hinbekomme! Kann mir jemand weiterheifen?
Ich gebe Euch mal den Code der ersten UserForm (die noch funktioniert) und den Code der zweiten UserForm, die nicht mehr angezeigt wird.... leider!
BITTE VERSUCHT MIR ZU HELFEN!!!!!!! DANKE!!!!!!!! Wenn es mir möglich erscheint, dann mache ich das wieder gut.
Hier der Code des Buttons:
Private Sub CommandButton1_Click()
Unload Me
UserForm2.Show
End Sub
Hier der Code der kompletten Userform (mit dem Button):
Private Sub CommandButton1_Click()
Unload Me
UserForm2.Show
End Sub
Private Sub CommandButton2_Click()
UserForm6.Show
End Sub
Private Sub CommandButton3_Click()
Unload Me
UserForm5.Show
End Sub
Private Sub CommandButton4_Click()
Unload Me
UserForm5.Show
End Sub
Private Sub CommandButton5_Click()
Application.Visible = True
Unload Me
End Sub
Private Sub UserForm_Activate()
UF.Maximize ' UserForm maximieren
'UF.Minimize ' UserForm minimieren
UF.Caption = "Reisekostenabrechnung | Reisedaten"
End Sub
Private Sub UserForm_Initialize()
Application.Visible = False
Me.ComboBox1.RowSource = "U48:U50"
Me.ComboBox1.ListIndex = 0
With UF
.MaxButton = True
.MinButton = True
.BorderStyle = xlFest
.Create Me
End With
End Sub
'Schließen über "X" nicht möglich...
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
If CloseMode = 0 Then
Cancel = 1
MsgBox "Bitte verlassen Sie die Reisekostenabrechnung über den Button >beenden<.", _
vbOKOnly + vbInformation, "Bitte auf >beenden< klicken."
End If
End Sub
Und hier noch der Code der zu öffnenden UserForm:
Option Explicit
Dim UF As New CUserForm
Private Sub CommandButton1_Click()
UserForm4.Show
End Sub
Private Sub CommandButton2_Click()
UserForm6.Show
End Sub
Private Sub CommandButton3_Click()
Unload Me
UserForm1.Show
End Sub
Private Sub CommandButton4_Click()
Unlod Me
UserForm2.Show
End Sub
Private Sub CommandButton5_Click()
Unload Me
UserForm5.Show
End Sub
Private Sub UserForm_Activate()
UF.Maximize ' UserForm maximieren
'UF.Minimize ' UserForm minimieren
UF.Caption = "Reisekostenabrechnung | Reiseverlauf"
End Sub
' von Textbox 2 bis 15 in A19:A32
' Reisetage
Private Sub UserForm_Initialize()
Application.Visible = False
TextBox2 = Sheets("Eingabe").[A19]
TextBox3 = Sheets("Eingabe").[A20]
TextBox4 = Sheets("Eingabe").[A21]
TextBox5 = Sheets("Eingabe").[A22]
TextBox6 = Sheets("Eingabe").[A23]
TextBox7 = Sheets("Eingabe").[A24]
TextBox8 = Sheets("Eingabe").[A25]
TextBox9 = Sheets("Eingabe").[A26]
TextBox10 = Sheets("Eingabe").[A27]
TextBox11 = Sheets("Eingabe").[A28]
TextBox12 = Sheets("Eingabe").[A29]
TextBox13 = Sheets("Eingabe").[A30]
TextBox14 = Sheets("Eingabe").[A31]
TextBox15 = Sheets("Eingabe").[A32]
' Landauswahl = False setzten
If TextBox2 = "" Then ComboBox1.Enabled = False
If TextBox3 = "" Then ComboBox2.Enabled = False
If TextBox4 = "" Then ComboBox3.Enabled = False
If TextBox5 = "" Then ComboBox4.Enabled = False
If TextBox6 = "" Then ComboBox5.Enabled = False
If TextBox7 = "" Then ComboBox6.Enabled = False
If TextBox8 = "" Then ComboBox7.Enabled = False
If TextBox9 = "" Then ComboBox8.Enabled = False
If TextBox10 = "" Then ComboBox9.Enabled = False
If TextBox11 = "" Then ComboBox10.Enabled = False
If TextBox12 = "" Then ComboBox11.Enabled = False
If TextBox13 = "" Then ComboBox12.Enabled = False
If TextBox14 = "" Then ComboBox13.Enabled = False
If TextBox15 = "" Then ComboBox14.Enabled = False
' Landauswahl setzen
ComboBox1.RowSource = "Eingabe!N4:N210"
ComboBox1.ControlSource = "Eingabe!b19"
ComboBox2.RowSource = "Eingabe!N4:N210"
ComboBox2.ControlSource = "Eingabe!b20"
ComboBox3.RowSource = "Eingabe!N4:N210"
ComboBox3.ControlSource = "Eingabe!b21"
ComboBox4.RowSource = "Eingabe!N4:N210"
ComboBox4.ControlSource = "Eingabe!b22"
ComboBox5.RowSource = "Eingabe!N4:N210"
ComboBox5.ControlSource = "Eingabe!b23"
ComboBox6.RowSource = "Eingabe!N4:N210"
ComboBox6.ControlSource = "Eingabe!b24"
ComboBox7.RowSource = "Eingabe!N4:N210"
ComboBox7.ControlSource = "Eingabe!b25"
ComboBox8.RowSource = "Eingabe!N4:N210"
ComboBox8.ControlSource = "Eingabe!b26"
ComboBox9.RowSource = "Eingabe!N4:N210"
ComboBox9.ControlSource = "Eingabe!b27"
ComboBox10.RowSource = "Eingabe!N4:N210"
ComboBox10.ControlSource = "Eingabe!b28"
ComboBox11.RowSource = "Eingabe!N4:N210"
ComboBox11.ControlSource = "Eingabe!b29"
ComboBox12.RowSource = "Eingabe!N4:N210"
ComboBox12.ControlSource = "Eingabe!b30"
ComboBox13.RowSource = "Eingabe!N4:N210"
ComboBox13.ControlSource = "Eingabe!b31"
ComboBox14.RowSource = "Eingabe!N4:N210"
ComboBox14.ControlSource = "Eingabe!b32"
'Datum anzeigen lassen
TextBox16 = Sheets("Eingabe").[C19]
TextBox17 = Sheets("Eingabe").[C20]
TextBox18 = Sheets("Eingabe").[C21]
TextBox19 = Sheets("Eingabe").[C22]
TextBox20 = Sheets("Eingabe").[C23]
TextBox21 = Sheets("Eingabe").[C24]
TextBox22 = Sheets("Eingabe").[C25]
TextBox23 = Sheets("Eingabe").[C26]
TextBox24 = Sheets("Eingabe").[C27]
TextBox25 = Sheets("Eingabe").[C28]
TextBox26 = Sheets("Eingabe").[C29]
TextBox27 = Sheets("Eingabe").[C30]
TextBox28 = Sheets("Eingabe").[C31]
TextBox29 = Sheets("Eingabe").[C32]
'Übernachtungs Art Hotel oder Privat
ComboBox15.RowSource = "Eingabe!J19:J22"
ComboBox15.ControlSource = "Eingabe!D19"
ComboBox16.RowSource = "Eingabe!J19:J22"
ComboBox16.ControlSource = "Eingabe!D20"
ComboBox17.RowSource = "Eingabe!J19:J22"
ComboBox17.ControlSource = "Eingabe!D21"
ComboBox18.RowSource = "Eingabe!J19:J22"
ComboBox18.ControlSource = "Eingabe!D22"
ComboBox19.RowSource = "Eingabe!J19:J22"
ComboBox19.ControlSource = "Eingabe!D23"
ComboBox20.RowSource = "Eingabe!J19:J22"
ComboBox20.ControlSource = "Eingabe!D24"
ComboBox21.RowSource = "Eingabe!J19:J22"
ComboBox21.ControlSource = "Eingabe!D25"
ComboBox22.RowSource = "Eingabe!J19:J22"
ComboBox22.ControlSource = "Eingabe!D26"
ComboBox23.RowSource = "Eingabe!J19:J22"
ComboBox23.ControlSource = "Eingabe!D27"
ComboBox24.RowSource = "Eingabe!J19:J22"
ComboBox24.ControlSource = "Eingabe!D28"
ComboBox25.RowSource = "Eingabe!J19:J22"
ComboBox25.ControlSource = "Eingabe!D29"
ComboBox26.RowSource = "Eingabe!J19:J22"
ComboBox26.ControlSource = "Eingabe!D30"
ComboBox27.RowSource = "Eingabe!J19:J22"
ComboBox27.ControlSource = "Eingabe!D31"
ComboBox28.RowSource = "Eingabe!J19:J22"
ComboBox28.ControlSource = "Eingabe!D32"
' Übernachtungsart = False setzten
If TextBox2 = "" Then ComboBox15.Enabled = False
If TextBox3 = "" Then ComboBox16.Enabled = False
If TextBox4 = "" Then ComboBox17.Enabled = False
If TextBox5 = "" Then ComboBox18.Enabled = False
If TextBox6 = "" Then ComboBox19.Enabled = False
If TextBox7 = "" Then ComboBox20.Enabled = False
If TextBox8 = "" Then ComboBox21.Enabled = False
If TextBox9 = "" Then ComboBox22.Enabled = False
If TextBox10 = "" Then ComboBox23.Enabled = False
If TextBox11 = "" Then ComboBox24.Enabled = False
If TextBox12 = "" Then ComboBox25.Enabled = False
If TextBox13 = "" Then ComboBox26.Enabled = False
If TextBox14 = "" Then ComboBox27.Enabled = False
If TextBox15 = "" Then ComboBox28.Enabled = False
'Tagessatzpauschale anzeigen lassen + Format ##.## ""
TextBox30 = Format(Sheets("Eingabe").Range("E19"), "#,##0.00 ")
TextBox31 = Format(Sheets("Eingabe").Range("E20"), "#,##0.00 ")
TextBox32 = Format(Sheets("Eingabe").Range("E21"), "#,##0.00 ")
TextBox33 = Format(Sheets("Eingabe").Range("E22"), "#,##0.00 ")
TextBox34 = Format(Sheets("Eingabe").Range("E23"), "#,##0.00 ")
TextBox35 = Format(Sheets("Eingabe").Range("E24"), "#,##0.00 ")
TextBox36 = Format(Sheets("Eingabe").Range("E25"), "#,##0.00 ")
TextBox37 = Format(Sheets("Eingabe").Range("E26"), "#,##0.00 ")
TextBox38 = Format(Sheets("Eingabe").Range("E27"), "#,##0.00 ")
TextBox39 = Format(Sheets("Eingabe").Range("E28"), "#,##0.00 ")
TextBox40 = Format(Sheets("Eingabe").Range("E29"), "#,##0.00 ")
TextBox41 = Format(Sheets("Eingabe").Range("E30"), "#,##0.00 ")
TextBox42 = Format(Sheets("Eingabe").Range("E31"), "#,##0.00 ")
TextBox43 = Format(Sheets("Eingabe").Range("E32"), "#,##0.00 ")
'Pauschal 50% anzeigen lassen + Format ##.## ""
TextBox44 = Format(Sheets("Eingabe").Range("F19"), "#,##0.00 ")
TextBox45 = Format(Sheets("Eingabe").Range("F20"), "#,##0.00 ")
TextBox46 = Format(Sheets("Eingabe").Range("F21"), "#,##0.00 ")
TextBox47 = Format(Sheets("Eingabe").Range("F22"), "#,##0.00 ")
TextBox48 = Format(Sheets("Eingabe").Range("F23"), "#,##0.00 ")
TextBox49 = Format(Sheets("Eingabe").Range("F24"), "#,##0.00 ")
TextBox50 = Format(Sheets("Eingabe").Range("F25"), "#,##0.00 ")
TextBox51 = Format(Sheets("Eingabe").Range("F26"), "#,##0.00 ")
TextBox52 = Format(Sheets("Eingabe").Range("F27"), "#,##0.00 ")
TextBox53 = Format(Sheets("Eingabe").Range("F28"), "#,##0.00 ")
TextBox54 = Format(Sheets("Eingabe").Range("F29"), "#,##0.00 ")
TextBox55 = Format(Sheets("Eingabe").Range("F30"), "#,##0.00 ")
TextBox56 = Format(Sheets("Eingabe").Range("F31"), "#,##0.00 ")
TextBox57 = Format(Sheets("Eingabe").Range("F32"), "#,##0.00 ")
'abzgl. Frühstück anzeigen lassen + Format ##.## ""
TextBox58 = Format(Sheets("Eingabe").Range("G19"), "#,##0.00 ")
TextBox59 = Format(Sheets("Eingabe").Range("G20"), "#,##0.00 ")
TextBox60 = Format(Sheets("Eingabe").Range("G21"), "#,##0.00 ")
TextBox61 = Format(Sheets("Eingabe").Range("G22"), "#,##0.00 ")
TextBox62 = Format(Sheets("Eingabe").Range("G23"), "#,##0.00 ")
TextBox63 = Format(Sheets("Eingabe").Range("G24"), "#,##0.00 ")
TextBox64 = Format(Sheets("Eingabe").Range("G25"), "#,##0.00 ")
TextBox65 = Format(Sheets("Eingabe").Range("G26"), "#,##0.00 ")
TextBox66 = Format(Sheets("Eingabe").Range("G27"), "#,##0.00 ")
TextBox67 = Format(Sheets("Eingabe").Range("G28"), "#,##0.00 ")
TextBox68 = Format(Sheets("Eingabe").Range("G29"), "#,##0.00 ")
TextBox69 = Format(Sheets("Eingabe").Range("G30"), "#,##0.00 ")
TextBox70 = Format(Sheets("Eingabe").Range("G31"), "#,##0.00 ")
TextBox71 = Format(Sheets("Eingabe").Range("G32"), "#,##0.00 ")
'Gesamt anzeigen lassen + Format ##.## ""
TextBox72 = Format(Sheets("Eingabe").Range("H19"), "#,##0.00 ")
TextBox73 = Format(Sheets("Eingabe").Range("H20"), "#,##0.00 ")
TextBox74 = Format(Sheets("Eingabe").Range("H21"), "#,##0.00 ")
TextBox75 = Format(Sheets("Eingabe").Range("H22"), "#,##0.00 ")
TextBox76 = Format(Sheets("Eingabe").Range("H23"), "#,##0.00 ")
TextBox77 = Format(Sheets("Eingabe").Range("H24"), "#,##0.00 ")
TextBox78 = Format(Sheets("Eingabe").Range("H25"), "#,##0.00 ")
TextBox79 = Format(Sheets("Eingabe").Range("H26"), "#,##0.00 ")
TextBox80 = Format(Sheets("Eingabe").Range("H27"), "#,##0.00 ")
TextBox81 = Format(Sheets("Eingabe").Range("H28"), "#,##0.00 ")
TextBox82 = Format(Sheets("Eingabe").Range("H29"), "#,##0.00 ")
TextBox83 = Format(Sheets("Eingabe").Range("H30"), "#,##0.00 ")
TextBox84 = Format(Sheets("Eingabe").Range("H31"), "#,##0.00 ")
TextBox85 = Format(Sheets("Eingabe").Range("H32"), "#,##0.00 ")
'Übernachtungspauschale anzeigen lassen + Format ##.## ""
TextBox87 = Format(Sheets("Eingabe").Range("I19"), "#,##0.00 ")
TextBox88 = Format(Sheets("Eingabe").Range("I20"), "#,##0.00 ")
TextBox89 = Format(Sheets("Eingabe").Range("I21"), "#,##0.00 ")
TextBox90 = Format(Sheets("Eingabe").Range("I22"), "#,##0.00 ")
TextBox91 = Format(Sheets("Eingabe").Range("I23"), "#,##0.00 ")
TextBox92 = Format(Sheets("Eingabe").Range("I24"), "#,##0.00 ")
TextBox93 = Format(Sheets("Eingabe").Range("I25"), "#,##0.00 ")
TextBox94 = Format(Sheets("Eingabe").Range("I26"), "#,##0.00 ")
TextBox95 = Format(Sheets("Eingabe").Range("I27"), "#,##0.00 ")
TextBox96 = Format(Sheets("Eingabe").Range("I28"), "#,##0.00 ")
TextBox97 = Format(Sheets("Eingabe").Range("I29"), "#,##0.00 ")
TextBox98 = Format(Sheets("Eingabe").Range("I30"), "#,##0.00 ")
TextBox99 = Format(Sheets("Eingabe").Range("I31"), "#,##0.00 ")
TextBox100 = Format(Sheets("Eingabe").Range("I32"), "#,##0.00 ")
'Summe anzeigen
TextBox86 = Format(Sheets("Eingabe").Range("I34"), "#,##0.00 ")
With UF
.MaxButton = True
.MinButton = True
.BorderStyle = xlFest
.Create Me
End With
End Sub
'Schließen über "X" nicht möglich...
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
If CloseMode = 0 Then
Cancel = 1
MsgBox "Bitte verlassen Sie die Reisekostenabrechnung über den Button >beenden<.", _
vbOKOnly + vbInformation, "Bitte auf >beenden< klicken."
End If
End Sub
Kann mir jemand weiterhelfen? Ich würde mich tierisch freuen, wenn das wieder klappen würde.....
DANKE DANKE DANKE!!!!!!!!!
Gruß,
Michael S.