VBA 使用 EXCEL 读取身份证阅读器获得证件信息本代码实现了在 EXCEL 中调用精伦身份证阅读器控件(可在网上百度精伦二次开发包,里面有)读取身份证信息,可根据实际情况修改相关代码,源文件可在 EXCELhome 网站搜索下载
Private Declare Function InitComm Lib "Sdtapi
dll" (ByVal iPort As Integer) As Integer Private Declare Function CloseComm Lib ”Sdtapi
dll" () As Integer Private Declare Function Authenticate Lib "Sdtapi
dll" () As Integer Private Declare Function ReadBaseInfos Lib "Sdtapi
dll" (ByVal iname As String, ByVal isex As String, ByVal folk As String, ByVal birthday As String, ByVal code As String, ByVal addr As String, ByVal agency As String, ByVal startdate As String, ByVal enddate As String) As Integer Sub 启动_Click() ’On Error Resume Next Dim n, ret, nLen Dim iname As String * 31 Dim isex As String * 3 Dim folk As String * 10 Dim code As String * 19 Dim addr As String * 71 Dim