MaikBisschop
Gebruiker
- Lid geworden
- 19 mrt 2018
- Berichten
- 39
Beste helpmij-ers,
Ik had een werkend userform. En nu ineens krijg ik "Permission denied (Error 70)"
Er wordt aangegeven een Array de oorzaak is. Maar het werkte eerst wel.
Misschien kunne jullie zien wat er niet goed is o.i.d. want ik kom niet meer verder.
Voorbeeldbestand is het userform en de stukken waar volgens mij de fouten zitten, zijn
aangegeven met 'Foutmelding
Voorbeeld!
Bekijk bijlage Error.xlsm
Misschien zie ik wel iets heel doms over het hoofd. Of heb ik iets perongeluk aangepast.
Ik hoop dat jullie kunnen helpen!
Met vriendelijke groet,
Maik Bisschop
Ik had een werkend userform. En nu ineens krijg ik "Permission denied (Error 70)"
Er wordt aangegeven een Array de oorzaak is. Maar het werkte eerst wel.
Misschien kunne jullie zien wat er niet goed is o.i.d. want ik kom niet meer verder.
Voorbeeldbestand is het userform en de stukken waar volgens mij de fouten zitten, zijn
aangegeven met 'Foutmelding
Code:
Private Sub Check()
'TextBox1
If Len(Me.TextBox1.Text) > 1 Then M1 = 1 Else M1 = 0
'TestBox2
If Len(Me.TextBox2.Text) > 1 Then M2 = 1 Else M2 = 0
'TextBox3
If Len(Me.TextBox3.Text) > 1 Then M3 = 1 Else M3 = 0
'TextBox4
If Len(Me.TextBox4.Text) > 1 Then M4 = 1 Else M4 = 0
'TextBox5
If (Me.TextBox5.Value Like "##[-]##[-]#### ##[:]##") Then M5 = 1 Else M5 = 0
'CheckBox1
If CheckBox1 = True Then TextBox5.Enabled = True Else TextBox5.Enabled = False
'ComboBox1
If ComboBox1.ListIndex > -1 Then M6 = 1 Else M6 = 0
'ComboBox2
If sheet2.Range("B8") = "Multibake® D" Then
ComboBox2.List = Array("OGB-L", "Wiremesh", "Steel", "Stone") [B]'Foutmelding[/B]
Else: End If
If ComboBox2.ListIndex > -1 Then M7 = 1 Else M7 = 0
'ComboBox3
ComboBox3.List = Array("Left", "Right")[B] 'Foutmelding[/B]
If ComboBox3.ListIndex > -1 Then M8 = 1 Else M8 = 0
'ComboBox4
ComboBox4.List = Array("Infeed left", "Infeed right", "Outfeed left", "Outfeed right") [B]'Foutmelding[/B]
If ComboBox4.ListIndex > -1 Then M9 = 1 Else M9 = 0
'ComboBox5
ComboBox5.List = Array("Left", "Right") [B]'Foutmelding[/B]
If sheet2.Range("B8") = "Multibake® D" Then Label10.Visible = True Else Label10.Visible = False
If sheet2.Range("B8") = "Multibake® D" Then ComboBox5.Visible = True Else ComboBox5.Visible = False
If ComboBox5.ListIndex > -1 Then M10 = 1 Else M10 = 0
'CommandButton3
If M1 And M2 And M3 And M4 And M5 And M6 And M7 And M8 And M9 And M10 = 1 Then
CommandButton3.Enabled = True
Else
CommandButton3.Enabled = False
End If
End Sub
Private Sub UserForm_Initialize()
Dim M1, M2, M3, M4, M5, M6, M7, M8, M9, M10 As Boolean
'ComboBox1
ComboBox1.List = Array("Multibake® D", "Multibake® D HT", "Multibake® I", "Multibake® R", "Multibake® H")
'Data to userform
TextBox1.Value = sheet2.Range("B3")
TextBox2.Value = sheet2.Range("B4")
TextBox3.Value = sheet2.Range("B5")
TextBox4.Value = sheet2.Range("B6")
TextBox5.Value = sheet2.Range("B7")
ComboBox1.Value = sheet2.Range("B8") [B]'Foutmelding[/B]
ComboBox2.Value = sheet2.Range("B9") [B]'Foutmelding[/B]
ComboBox3.Value = sheet2.Range("B10") [B]'Foutmelding[/B]
ComboBox4.Value = sheet2.Range("B11") [B]'Foutmelding[/B]
ComboBox5.Value = sheet2.Range("B12") [B]'Foutmelding[/B]
'Check
Check
End Sub
Private Sub TextBox1_Change()
sheet2.Range("B3") = TextBox1.Value
Check
End Sub
Private Sub TextBox2_Change()
sheet2.Range("B4") = TextBox2.Value
Check
End Sub
Private Sub TextBox3_Change()
sheet2.Range("B5") = TextBox3.Value
Check
End Sub
Private Sub TextBox4_Change()
sheet2.Range("B6") = TextBox4.Value
Check
End Sub
Private Sub TextBox5_Change()
sheet2.Range("B7") = TextBox5.Value
Check
End Sub
Private Sub ComboBox1_Change()
If ComboBox1.Value = "Multibake® D" Then sheet2.Range("B8") = ComboBox1.Value
If ComboBox1.Value = "Multibake® D HT" Then MsgBox "Multibake® D HT not available yet!", vbExclamation, "Error"
If ComboBox1.Value = "Multibake® I" Then MsgBox "Multibake® I not available yet!", vbExclamation, "Error"
If ComboBox1.Value = "Multibake® R" Then MsgBox "Multibake® R not available yet!", vbExclamation, "Error"
If ComboBox1.Value = "Multibake® H" Then MsgBox "Multibake® H not available yet!", vbExclamation, "Error"
Check
End Sub
Private Sub ComboBox2_Change()
sheet2.Range("B9") = ComboBox2.Value
Check
End Sub
Private Sub ComboBox3_Change()
sheet2.Range("B10") = ComboBox3.Value
Check
End Sub
Private Sub ComboBox4_Change()
sheet2.Range("B11") = ComboBox4.Value
Check
End Sub
Private Sub ComboBox5_Change()
sheet2.Range("B12") = ComboBox5.Value
Check
End Sub
Private Sub CheckBox1_Change()
Check
End Sub
Private Sub CommandButton1_Click()
TextBox5.Value = Now
TextBox5 = Format(TextBox5.Value, "dd/mm/yyyy hh:mm")
Check
End Sub
Private Sub CommandButton2_Click()
MsgBox "Adminform niet in voorbeeld", vbCritical
End Sub
Private Sub CommandButton3_Click()
MsgBox "Volgende UserForm niet in voorbeeld", vbCritical
End Sub
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
If CloseMode <> 1 Then Cancel = 1
Dim Answer As String
Dim MyNote As String
MyNote = "If you close the form, the data will NOT be saved! Continue?"
Answer = MsgBox(MyNote, vbQuestion + vbYesNo, "Are you sure?")
If Answer = vbYes Then
Application.Quit
ActiveWorkbook.Close savechanges:=False
Else: End If
End Sub
Voorbeeld!
Bekijk bijlage Error.xlsm
Misschien zie ik wel iets heel doms over het hoofd. Of heb ik iets perongeluk aangepast.
Ik hoop dat jullie kunnen helpen!
Met vriendelijke groet,
Maik Bisschop
Laatst bewerkt: