Private Sub Command1_Click() On Error Goto OnError ' use intrinsic error handling Dim Store As New CertificateStore Dim Certificate As Certificate ' Get the certificates in "MY" certificate store located in the ' Local Machine registry key. Store.Name = "MY" Store.Location = locationLocalMachine ' Must use Refresh to populate Store.Certificates Store.Refresh MsgBox "There are " & Store.Certificates.Count & " certificates." For Each Certificate In Store.Certificates MsgBox "Owner is " & Certificate.IssuedTo _ & vbCrLf & "Issuer is " & Certificate.IssuedBy _ & vbCrLf & "Certificate version is " & Certificate.Version _ & vbCrLf & "Valid From " & Certificate.ValidFrom & " to " & Certificate.ValidTo _ & vbCrLf & "Serial Number is " & Certificate.SerialNumber _ & vbCrLf & "KeyName is " & Certificate.KeyName _ & vbCrLf & "KeySize is " & Certificate.KeySize Next Exit Sub OnError: ' Any error jumps here Debug.Print "Error #" + CStr(Err.Number) + ": " + Err.Description End Sub