Als ik met F8 er doorheen loop dan geeft VBA geen melding weer. De fout controle verspringt met geel gearceerde delen door de code zonder melding.
Het enige wat verschilt is dat in de 4e en de laatste IF regel het dik gedrukte deel ook geel wordt gearceerd als ik met F8 er doorheen loop. Bij de andere regels wordt alleen het eerste deel van de regel geel gearceerd (vb: If [B26] = "Bilateral Refund" Or [B26] = "Bilateral Reduction" And [C30] = True Then). Betekent dit iets?
Sub Document_Openen()
On Error GoTo Oeps
Dim objWordApp As Object, objWordDoc As Object
If [B26] <> "Bilateral Refund" And _
[B26] <> "Bilateral Reduction" And _
[B26] <> "EU-Treaty" And _
[B26] <> "Domestic law" Then
MsgBox "No Possibilities !": Exit Sub
End If
If [B26] = "Bilateral Refund" Or [B26] = "Bilateral Reduction" And [C30] = True Then bestand = "D:\bla\bla\word document 2"
If [B26] = "EU-Treaty" Or [B26] = "Domestic law" And [C30] = True Then bestand = "D:\bla\bla\word document 2"
If [B26] = "Bilateral Refund" Or [B26] = "Bilateral Reduction" And [C31] = True Then bestand = "D:\bla\bla\word document"
If [B26] = "EU-Treaty" Or [B26] = "Domestic law" And [C31] = True Then bestand = "D:\bla\bla\word document"
If [B26] = "Bilateral Refund" Or [B26] = "Bilateral Reduction" And [C32] = True Then bestand = "D:\bla\bla\word document"
If [B26] = "EU-Treaty" Or [B26] = "Domestic law" And [C32] = True Then bestand = "D:\bla\bla\word document"
If [B26] = "Bilateral Refund" Or [B26] = "Bilateral Reduction" And [C33] = True Then bestand = "D:\bla\bla\word document"
If [B26] = "EU-Treaty" Or [B26] = "Domestic law" And [C33] = True Then bestand = "D:\bla\bla\word document"
If [B26] = "Bilateral Refund" Or [B26] = "Bilateral Reduction" And [C34] = True Then bestand = "D:\bla\bla\word document"
If [B26] = "EU-Treaty" Or [B26] = "Domestic law" And [C34] = True Then bestand = "D:\bla\bla\word document"
If [B26] = "Bilateral Refund" Or [B26] = "Bilateral Reduction" And [C35] = True Then bestand = "D:\bla\bla\word document"
If [B26] = "EU-Treaty" Or [B26] = "Domestic law" And [C35] = True Then bestand = "D:\bla\bla\word document"
If [B26] = "Bilateral Refund" Or [B26] = "Bilateral Reduction" And [C36] = True Then bestand = "D:\bla\bla\word document"
If [B26] = "EU-Treaty" Or [B26] = "Domestic law" And [C36] = True Then bestand = "D:\bla\bla\word document"
If [B26] = "Bilateral Refund" Or [B26] = "Bilateral Reduction" And [C37] = True Then bestand = "D:\bla\bla\word document"
If [B26] = "EU-Treaty" Or [B26] = "Domestic law" And [C37] = True Then bestand = "D:\bla\bla\word document"
If [B26] = "Bilateral Refund" Or [B26] = "Bilateral Reduction" And [C38] = True Then bestand = "D:\bla\bla\word document"
If [B26] = "EU-Treaty" Or [B26] = "Domestic law" And [C38] = True Then bestand = "D:\bla\bla\word document"
Set objWordApp = CreateObject("Word.application")
objWordApp.Visible = True
Set objWordDoc = objWordApp.Documents.Open(bestand)
Oeps:
End Sub
Het enige wat verschilt is dat in de 4e en de laatste IF regel het dik gedrukte deel ook geel wordt gearceerd als ik met F8 er doorheen loop. Bij de andere regels wordt alleen het eerste deel van de regel geel gearceerd (vb: If [B26] = "Bilateral Refund" Or [B26] = "Bilateral Reduction" And [C30] = True Then). Betekent dit iets?
Sub Document_Openen()
On Error GoTo Oeps
Dim objWordApp As Object, objWordDoc As Object
If [B26] <> "Bilateral Refund" And _
[B26] <> "Bilateral Reduction" And _
[B26] <> "EU-Treaty" And _
[B26] <> "Domestic law" Then
MsgBox "No Possibilities !": Exit Sub
End If
If [B26] = "Bilateral Refund" Or [B26] = "Bilateral Reduction" And [C30] = True Then bestand = "D:\bla\bla\word document 2"
If [B26] = "EU-Treaty" Or [B26] = "Domestic law" And [C30] = True Then bestand = "D:\bla\bla\word document 2"
If [B26] = "Bilateral Refund" Or [B26] = "Bilateral Reduction" And [C31] = True Then bestand = "D:\bla\bla\word document"
If [B26] = "EU-Treaty" Or [B26] = "Domestic law" And [C31] = True Then bestand = "D:\bla\bla\word document"
If [B26] = "Bilateral Refund" Or [B26] = "Bilateral Reduction" And [C32] = True Then bestand = "D:\bla\bla\word document"
If [B26] = "EU-Treaty" Or [B26] = "Domestic law" And [C32] = True Then bestand = "D:\bla\bla\word document"
If [B26] = "Bilateral Refund" Or [B26] = "Bilateral Reduction" And [C33] = True Then bestand = "D:\bla\bla\word document"
If [B26] = "EU-Treaty" Or [B26] = "Domestic law" And [C33] = True Then bestand = "D:\bla\bla\word document"
If [B26] = "Bilateral Refund" Or [B26] = "Bilateral Reduction" And [C34] = True Then bestand = "D:\bla\bla\word document"
If [B26] = "EU-Treaty" Or [B26] = "Domestic law" And [C34] = True Then bestand = "D:\bla\bla\word document"
If [B26] = "Bilateral Refund" Or [B26] = "Bilateral Reduction" And [C35] = True Then bestand = "D:\bla\bla\word document"
If [B26] = "EU-Treaty" Or [B26] = "Domestic law" And [C35] = True Then bestand = "D:\bla\bla\word document"
If [B26] = "Bilateral Refund" Or [B26] = "Bilateral Reduction" And [C36] = True Then bestand = "D:\bla\bla\word document"
If [B26] = "EU-Treaty" Or [B26] = "Domestic law" And [C36] = True Then bestand = "D:\bla\bla\word document"
If [B26] = "Bilateral Refund" Or [B26] = "Bilateral Reduction" And [C37] = True Then bestand = "D:\bla\bla\word document"
If [B26] = "EU-Treaty" Or [B26] = "Domestic law" And [C37] = True Then bestand = "D:\bla\bla\word document"
If [B26] = "Bilateral Refund" Or [B26] = "Bilateral Reduction" And [C38] = True Then bestand = "D:\bla\bla\word document"
If [B26] = "EU-Treaty" Or [B26] = "Domestic law" And [C38] = True Then bestand = "D:\bla\bla\word document"
Set objWordApp = CreateObject("Word.application")
objWordApp.Visible = True
Set objWordDoc = objWordApp.Documents.Open(bestand)
Oeps:
End Sub