none
VBA script to Create Excel.Application fails when Power Query and a Excel 2010 Add-In installed together RRS feed

  • Question

  • Hi Team,

    I am facing an issue when trying to run the below VBA script from Excel when I have Power Query and an Excel Add-In installed and active. This happens only when the Excel Add-In loads after the Power Query does. (I tried this by renaming the assembly name as Excel loads the addins alphabetically). The Excel Add-In is the default template project(Templates->C#->Office/SharePoint->Office Add-ins->Excel 2010 Add-in) created with .net framework 4.0 and is a 2010 Add-In.

    Dim xlApp As Excel.Application
    Public Sub test()
    Set xlApp = CreateObject("Excel.Application")
    Set objBook = xlApp.Workbooks.Add
    xlApp.Visible = True
    End Sub

    Error thrown is 'Run-time error '429':  ActiveX component cant create object.'

    And this is captured in the Event Logs

    Source: VSTO 4.0

    Details: Exception: The deployment manifest could not be downloaded because a connection to the network could not be established. Ensure that you can connect to the network, and try again.

    ************** Exception Text **************
    System.TimeoutException: The deployment manifest could not be downloaded because a connection to the network could not be established. Ensure that you can connect to the network, and try again.
       at Microsoft.VisualStudio.Tools.Applications.Deployment.ClickOnceAddInDeploymentManager.GetManifests(TimeSpan timeout)
       at Microsoft.VisualStudio.Tools.Applications.Deployment.ClickOnceAddInDeploymentManager.InstallAddIn()

    Can you please guide me to resolve this?

    Thanks,

    Sridhar.


    Monday, June 12, 2017 10:09 AM

All replies

  • Hi Sridhar,

    I create a 2010 Add-in named begin with Z for loading after Power Query. I tried to run the macro and there is no error. What did you do in the excel add-in? If you load the Excel Add-in before Power Query, will you get the error? Does this occur on every excel file or specific file? You could comment out the code in your excel add-in to find which may cause this issue. I also suggest you create an empty excel add-in and the check if the issue persists. Besides, where did you get the event log? It seems that a deployed add-in need to be updated form internet path but network connection is wrong. I did find association between it and your problem.

    Best Regards,

    Terry

    Wednesday, June 14, 2017 7:19 AM
  • Hi Terry,

    Thank you for your reply. The Add-In I am trying is a blank one, created from the template. I've tried downloading the source code from this link https://code.msdn.microsoft.com/VSTO-Deploy-an-Office-fbcc09ad and its the same behavior. If the add in loads after the Power Query, and when i try the macro, it throws the error.

    Please find the answers below:

    What did you do in the excel add-in? - Blank project (Default Template from VS 2012)

    If you load the Excel Add-in before Power Query, will you get the error? (If i rename the add-in so that it loads before the Power Query, this error is not thrown. The error is thrown only when the addin loads after Power Query does)

    Does this occur on every excel file or specific file? Yes, This happens with every Project I create on my machine.

    where did you get the event log? I get this log from Event Viewer>Windows Logs>Application

    Please suggest on how I can proceed to solve this. Appreciate your help on this.

    Thanks,

    Sridhar.


    • Edited by Sridz Wednesday, June 14, 2017 10:51 AM Update
    Wednesday, June 14, 2017 10:49 AM
  • Hi Sridhar,

    Have you test this on another computer? I suggest you reinstall the latest version of Power Query add-in or repair your office to check if the situation persists. You could download the latest Power Query from here.

    Best Regards,

    Terry

    Friday, June 16, 2017 10:32 AM