ISSUE #7008

    The ProgId could not be found on computer where this application was migrated

    Description

    This specific issue arises when converting VB6 applications that use API calls to interact with programs from the Microsoft Office suite, such as Word , Excel or PowerPoint; the issue appears in in the upgraded code if the application is converted on a machien that does not have the Microsoft Office components installed.

    Recommendations

    There are two different options to remove the issue:

    • Option 1: Install the Microsoft Office components and then convert the application again using VBUC.
    • Option 2: Solve this issue manually.

    If the there are too many occurrences of this issue in the upgraded code, Option 1 is the recommended one, otherwise Option 2 will work.

    Sample VB6

    Dim oWordApplication As Object 

    Set oWordApplication = GetObject(, "Word.Application")

    If oWordApplication Is Nothing Then

    Set oWordApplication = CreateObject("Word.Application")

    End If

    If oWordApplication Is Nothing Then

    Err.Raise vbObjectError + 1, , " Word Application not installed on MVBS server "

    End If

    Target VB.NET

    Dim oWordApplication As Object = Interaction.GetObject(String.Empty, "Word.Application")

    If oWordApplication Is Nothing Then

    'UPGRADE_WARNING: (7008) The ProgId could not be found on computer where this application was migrated

    oWordApplication = Activator.CreateInstance(Type.GetTypeFromProgID("Word.Application"))

    End If

    If oWordApplication Is Nothing Then

    Throw New System.Exception((Constants.vbObjectError + 1).ToString() + ", Word Application not installed on MVBS server ")

    End If

    Expected VB.NET

    Dim oWordApplication As Word.Application = System.Runtime.InteropServices.Marshal.GetActiveObject("Word.Application")

    If oWordApplication Is Nothing Then

    oWordApplication = New Word.Application

    End If

    If oWordApplication Is Nothing Then

    Throw New System.Exception((Constants.vbObjectError + 1).ToString() + ", " + + ", Word Application not installed on MVBS server ")

    End If

    Target C#

    object oWordApplication = Interaction.GetObject(String.Empty, "Word.Application");

    if (oWordApplication == null)

    {

    //UPGRADE_WARNING: (7008) The ProgId could not be found on computer where this application was migrated

    oWordApplication = Activator.CreateInstance(Type.GetTypeFromProgID("Word.Application"));

    }

    if (oWordApplication == null)

    {

    throw new System.Exception((Constants.vbObjectError + 1).ToString() + ", Word Application not installed on MVBS server ");

    }

    Expected C#

    Word.Application oWordApplication = (Word.Application) Interaction.GetObject(String.Empty, "Word.Application");

    if (oWordApplication == null)

    {

    oWordApplication = new Word.Application();

    }

    if (oWordApplication == null)

    {

    throw new System.Exception((Constants.vbObjectError + 1).ToString() + ", Word Application not installed on MVBS server ");

    }


    Download VBUC Free Trial
    Download VBUC Now

    It's time to eradicate VB6
    ROI of eradicating VB6

    8 Proven Tips for
    Planning a Successful Migration

    8 Tips for migration