Skip to content

VBA EID-wrapper - Foreigner EID #15

@Sieg112

Description

@Sieg112

I have the code below in my VBA in Excel. This works fine with Belgian EIDs, but it does not work with EIDs from Belgium as a foreigner.

Which fields are there to be loaded that I am missing?

Private Sub cmdInladen_Click()

Dim Foto As String

cmdInladen.Enabled = False

'On Error GoTo Err_CmdEIDTest_Click
Dim wrapper As New EID_Wrapper.wrapper
Dim data As EID_Wrapper.CardData
Set data = wrapper.GetCardData()

'Check of er een EID kaart (op de juiste manier) in de kaartlezer zit
If data.FirstCard Is Nothing Then
MsgBox "Geen EID kaart in lezer gedetecteerd!" & vbCrLf & _
"Plaats de EID van de persoon in de lezer," & vbCrLf & _
"of controleer of ze goed geplaatst is.", vbCritical + vbOKOnly, "Geen kaart gedetecteerd!"
Unload Me

Exit Sub

End If

' The CardStatus veld bevat de nodige informatie
' Toon de EID Kaart Data in een messagebox
' Save the photo to the disk. Make sure this is a user-accessible directory!

lblVoornaam.Caption = (data.FirstCard.FirstNames)
lblNaam.Caption = (data.FirstCard.Surname)
lblGeslacht.Caption = (data.FirstCard.Gender)
lblGeboorte.Caption = (data.FirstCard.BirthDate)
lblGeboortePlaats.Caption = (data.FirstCard.BirthPlace)
lblAdres.Caption = (data.FirstCard.StreetAndNumber)
lblPostcode.Caption = (data.FirstCard.ZipCode)
lblGemeente.Caption = (data.FirstCard.Municipality)
lblNationaliteit.Caption = (data.FirstCard.Nationality)
lblRijksregister.Caption = (data.FirstCard.NationalNumber)

'Randomize

fotoNaam = lblVoornaam.Caption & "." & lblNaam.Caption & "." & lblGeboorte.Caption

Foto = "c:\ODT" & fotoNaam & ".jpg"
data.FirstCard.SavePhoto (Foto)
Foto = "c:\ODT" & fotoNaam & ".jpg"

' foto = ActiveWorkbook.Path & "" & Label2.Caption & Label1.Caption & Label4.Caption & ".jpg"
' Now display the picture in an imagebox
imgFoto.Picture = LoadPicture(Foto)

Kill Foto

cmdOverbrengen.Visible = True

Exit_CmdEIDTest_Click:
Exit Sub
Err_CmdEIDTest_Click:
Select Case Err.Number
Case 9999
Resume Next
Case 999
Resume Exit_CmdEIDTest_Click

Resume Exit_CmdEIDTest_Click
End Select
End Sub

Private Sub cmdOverbrengen_Click()

Range("D25").Value = lblNaam
Range("I25").Value = lblVoornaam
Range("D28").Value = lblRijksregister

Me.Repaint

ActiveWorkbook.Save

Unload Me

End Sub

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions