VCF to Excel Converter – VBA Code to Read vCard File

How To Convert VCF To Excel?

To convert contacts in VCF to Excel, You can use one of these methods.

  1. Download our vCard to Excel App
  2. Excel VBA Conversion Code – Customizable
  3. Outlook Contacts Export option
  4. Mobile Applications.

VCF is the most desired file format to store contact details. But is not easy to manually manage in that format. It would be easy to maintain the contacts if it is in Excel format.

1. Download vCard To Excel Converter App

This will convert the VCF fields and data into Excel table format with proper column headers. Here is the download link to try…

 

Download Trial VCF to Excel Converter

Downloaded 31,011 Times

or

Buy for just 5$ USD

(Unlimited Contacts Conversion)

 

Whats more available than this app? A simple version of Excel macro code that converts vCard to xls is also given below.

2. Vba Code to open .vcf file in Excel/Csv

Here are the steps to code Excel vcf importer.

  1. Open new Excel workbook.
  2. Press Alt + F11 to view the VB Editor.
  3. Copy paste the below code in VBE.
  4. Change the path for the VCF file in the field ‘VCF_File_Path’.
  5. Execute the code by pressing F5. (How to Run Macro in Excel – If you are beginner)
'Code Downloaded From Officetricks.com
'External Properties & Functions Declaration
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hWnd As Long, ByVal Operation As String, ByVal Filename As String, Optional ByVal Parameters As String, Optional ByVal Directory As String, Optional ByVal WindowStyle As Long = vbMinimizedFocus) As Long
Private Sub VCFToExcel()

    '.vcf File to Excel Conversion code
    'Assign the Path of the VCF file here
    VCF_File_Path = ThisWorkbook.Path & "\Vcf_to_Excel.VCF"

    'Open .vcf File in Excel (read mode)
    intfilenum1 = FreeFile
    Open VCF_File_Path For Input As intfilenum1
    icol = 0
    irow = 1

    'Read .vcf File line by line till End Of File
    While Not VBA.EOF(intfilenum1)
        Line Input #intfilenum1, filetext

        'If VCF file has Profile Photo Information, Skip/Enable as per your need
        If VBA.InStr(1, filetext, "PHOTO;", vbTextCompare) > 0 Or VBA.Mid(filetext, 1, 1) = " " Then GoTo Read_Next_Line:

        'Identify beginning of vCard Contact Information
        If VBA.Trim(VBA.UCase(filetext)) = VBA.Trim("BEGIN:VCARD") Then
            irow = irow + 1
            icol = 0
        End If

        'Write Contact Information to Excel Sheet
        icol = icol + 1
        ThisWorkbook.Sheets(1).Cells(irow, icol).Select
        ThisWorkbook.Sheets(1).Cells(irow, icol) = filetext

Read_Next_Line:
    Wend
    MsgBox "Thanks For Visiting. Subscribe Your Email with Us to get Free Latest updates"
    ShellExecute 0, "Open", "http://officetricks.com/email-subscription-page/"
    Close intfilenum1

End_Process:
    MsgBox "Converting VCF to Excel Completed"
End Sub

2(a) Customize VCF to Excel Converter VBA code

Convert VCF to Excel - vCard to Xls
VCF to Xls Conversion

After executing above code, refer to first sheet in the workbook. It will have the vCard contacts imported.

As said earlier, it does not give a completely customized tool to strip the vCard format tags. It only display basic contact information.

This code can be enhanced to omit the tags like BEGIN: or VERSION: as how I have removed the tag PHOTO: to get a complete VCF file to Excel automated tool. Also you can add other tags that correspond to email id, additional telephone number etc.,

Note: As a caution, please take a back up of the vCard file & save the excel file with .xlsm extension, before executing the code.

What if there are multiple VCF files: How to Merge if there are multiple VCF Files?

3. Microsoft Outlook as VCF to Excel converter

To convert VCARD to Excel for free, double click on .vcf file & open it with Microsoft Outlook application. It will update all the contacts to Outlook contacts.

To export contacts from Outlook to Excel use the below steps.

Export Outlook Contacts to Excel:

  1. Choose ‘Contacts’ from outlook app.
  2. Click File Menu & choose ‘Import and Export’ option. (Shortcut ‘Alt + F + T).
  3. Select “Export to File” & click next.
  4. Choose “Microsoft Excel 97-2003”, Click next.
  5. Choose Contacts to be converted to Excel.
  6. Type Output file name & path.
  7. Click next and then “Finish”.

Now Outlook will convert your contacts from .vcf file to Excel with this indirect method.

The Excel file with contacts will be generated in the path that you have mentioned during export option.

4. Convert vCard to Excel – Mobile Contacts to Xlsx

To convert your mobile contacts in vCard file to Excel, follow mobile specific recommendations given below.

Android: “Contacts Backup – Excel & Email” by Eastros Pvt Ltd for Android has comparatively a large number of download and good rating when compared to other available apps.

iPhone: Click here CopyTrans Contacts to know more about this iPhone iOS product that will serve the purpose.

There are few other products available to export mobile contacts to Excel in the Google Play Store & iPhone App Store. But the above apps would be suffice for our purpose.

Also Read: How to Convert Contacts in Excel or .CSV to VCF?

Using VCF to Excel converter as Android Contact Manager

The Excel macro just uses the VB File read operations which is nothing different from reading a plain text file. But still it handles minimal VCF format tags and imports vCard as one contact per row in excel.

The code reads contacts in VCF file one by one and its Tags. It parses the detail from each tag and writes into Excel. Once all the contacts are imported in Excel, the file can be saved to a CSV format. This is how we can convert VCF to Excel/CSV format.

The imported contact will be comparatively good for the user’s eyes to refer than opening and manually reading the vCard File. This option works fine for a Vcard file exported from an Android Mobile and we can manage the contacts in this way.

What Else Can we Import to Excel

[noads]

Summary
Developer Rating
1star1star1star1star1star
3 based on 14 votes
Software Name
VCF to Excel CSV Converter
Operating System
Windows
Software Category
Desktop
Price
USD 0
Landing Page

5 thoughts on “VCF to Excel Converter – VBA Code to Read vCard File”

  1. Please define the method for input of vcf file path. Suppose I keep a VCF file on my desktop then what would be the syntax?

    1. Hai Tiwari,
      Appreciate Your Suggestion & Interest.
      Actually
      there is a way to define the input path for the file in the sample code.
      Please include the actual path of the file in this line.
      VCF_File_Path = ThisWorkbook.Path & “0004.VCF”
      Replace the above similar to example as below:
      VCF_File_Path = “C:UsersKumarDesktop” & “0004.VCF” Hope this helps.

  2. Thіѕ
    іѕ a vеrу uѕеful guіdе for thоѕе whо аrе dіѕроѕеd tо lеаrnіng hоw tо rеmоvе
    unwanted оr unuѕеd оld соntасtѕ frоm Andrоіd аnd аlѕо bulk uрlоаd a hugе lіѕt
    оf соntасtѕ frоm аn Exсеl оf CSV tо VCF аnd іmроrt thеm іntо Cоntасtѕ оf
    Andrоіd fоr Andrоіd uѕеrѕ.

  3. There are a few automation scripts which backup my contacts to an excel file, but they always seem to misfire on my phone. This is great, it allows me to backup all my contacts into excel, then when I get a new phone I can use your other guide to import them back in!

Comments are closed.