<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: HRESULT E_FAIL has been returned from a call to a com component in ArcGIS Network Analyst Questions</title>
    <link>https://community.esri.com/t5/arcgis-network-analyst-questions/hresult-e-fail-has-been-returned-from-a-call-to-a/m-p/431262#M4102</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks Michael and Steven. I will send you the data, layer file, .net project and also instruction via email. The network dataset we are using is from our customers. Appreciate your help.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 23 Sep 2010 17:34:40 GMT</pubDate>
    <dc:creator>NagmaYasmin</dc:creator>
    <dc:date>2010-09-23T17:34:40Z</dc:date>
    <item>
      <title>HRESULT E_FAIL has been returned from a call to a com component</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/hresult-e-fail-has-been-returned-from-a-call-to-a/m-p/431249#M4089</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I started to get HRESULT error when trying to solve network dataset in Arc10 programatically. In 9.3, the code works fine. It is in vb.net. In program i added code to release object and garbage collector, but nothing helps.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any idea? Appreciate any help.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Nagma&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Sep 2010 12:17:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/hresult-e-fail-has-been-returned-from-a-call-to-a/m-p/431249#M4089</guid>
      <dc:creator>NagmaYasmin</dc:creator>
      <dc:date>2010-09-17T12:17:48Z</dc:date>
    </item>
    <item>
      <title>Re: HRESULT E_FAIL has been returned from a call to a com component</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/hresult-e-fail-has-been-returned-from-a-call-to-a/m-p/431250#M4090</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Can you post your code (or at least, the portion of the code where you are getting errors)?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Sep 2010 17:40:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/hresult-e-fail-has-been-returned-from-a-call-to-a/m-p/431250#M4090</guid>
      <dc:creator>MichaelRice</dc:creator>
      <dc:date>2010-09-17T17:40:04Z</dc:date>
    </item>
    <item>
      <title>Re: HRESULT E_FAIL has been returned from a call to a com component</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/hresult-e-fail-has-been-returned-from-a-call-to-a/m-p/431251#M4091</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Micael,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks so much for your reply. I am trying create a route usining couple of stops. I am getting error in this line at the bottom of attached document:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; m_pNAContext.Solver.Solve(m_pNAContext, pGPMessages, Nothing)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please see the attcahed code. I added some code to release system resource, but doesn't work.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In 9.3, didn't get any error, but it started to happen in Arc10.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for your help.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Nagma&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Sep 2010 11:47:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/hresult-e-fail-has-been-returned-from-a-call-to-a/m-p/431251#M4091</guid>
      <dc:creator>NagmaYasmin</dc:creator>
      <dc:date>2010-09-20T11:47:57Z</dc:date>
    </item>
    <item>
      <title>Re: HRESULT E_FAIL has been returned from a call to a com component</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/hresult-e-fail-has-been-returned-from-a-call-to-a/m-p/431252#M4092</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I see in your code that you have a try/catch block around the solve and you report the first GPMessage returned by the solver upon failure. Have you checked to see if there are any other messages in the GPMessages object? There can be multiple messages, and there may be more detailed information in this object that will help to narrow down the problem. Try this first, and we can proceed from there.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Sep 2010 14:50:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/hresult-e-fail-has-been-returned-from-a-call-to-a/m-p/431252#M4092</guid>
      <dc:creator>MichaelRice</dc:creator>
      <dc:date>2010-09-20T14:50:03Z</dc:date>
    </item>
    <item>
      <title>Re: HRESULT E_FAIL has been returned from a call to a com component</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/hresult-e-fail-has-been-returned-from-a-call-to-a/m-p/431253#M4093</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks. In catch I get com exception but for gpMessages I get the message "Value does not fall within expected range". Don't have any idea why in Arc10 I get this message.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I see in your code that you have a try/catch block around the solve and you report the first GPMessage returned by the solver upon failure. Have you checked to see if there are any other messages in the GPMessages object? There can be multiple messages, and there may be more detailed information in this object that will help to narrow down the problem. Try this first, and we can proceed from there.&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Sep 2010 17:27:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/hresult-e-fail-has-been-returned-from-a-call-to-a/m-p/431253#M4093</guid>
      <dc:creator>NagmaYasmin</dc:creator>
      <dc:date>2010-09-20T17:27:27Z</dc:date>
    </item>
    <item>
      <title>Re: HRESULT E_FAIL has been returned from a call to a com component</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/hresult-e-fail-has-been-returned-from-a-call-to-a/m-p/431254#M4094</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Is this the only message in the GPMessages object, or just the first message? If there are more, can you report those as well?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Sep 2010 17:29:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/hresult-e-fail-has-been-returned-from-a-call-to-a/m-p/431254#M4094</guid>
      <dc:creator>MichaelRice</dc:creator>
      <dc:date>2010-09-20T17:29:57Z</dc:date>
    </item>
    <item>
      <title>Re: HRESULT E_FAIL has been returned from a call to a com component</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/hresult-e-fail-has-been-returned-from-a-call-to-a/m-p/431255#M4095</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yes, this is the only message I get. There is also stack trace, may be that will help. Please see the attcahed document.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Sep 2010 17:47:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/hresult-e-fail-has-been-returned-from-a-call-to-a/m-p/431255#M4095</guid>
      <dc:creator>NagmaYasmin</dc:creator>
      <dc:date>2010-09-20T17:47:06Z</dc:date>
    </item>
    <item>
      <title>Re: HRESULT E_FAIL has been returned from a call to a com component</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/hresult-e-fail-has-been-returned-from-a-call-to-a/m-p/431256#M4096</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Looking at your last email, the error appears to be coming from a call to some IArray variable. This is likely coming from one of the IStringArray variables passed to the solver (e.g., for accumulate attribute names, etc.).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In your code, I notice you have the following:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;' Dim AccumulateAttributes As IStringArray 'changed 09_16&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim AccumulateAttributes As StrArray&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there a reason you recently changed this code from using the IStringArray interface? Perhaps this is somehow part of the problem. Can you change the code back to how it was or comment out your use of the accumulate attributes altogether to see if this is the issue?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Sep 2010 19:54:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/hresult-e-fail-has-been-returned-from-a-call-to-a/m-p/431256#M4096</guid>
      <dc:creator>MichaelRice</dc:creator>
      <dc:date>2010-09-20T19:54:44Z</dc:date>
    </item>
    <item>
      <title>Re: HRESULT E_FAIL has been returned from a call to a com component</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/hresult-e-fail-has-been-returned-from-a-call-to-a/m-p/431257#M4097</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I changed the code after I started to get the error, I thought there might have changed in Arc10. I got back to original code, it is the same error I am getting. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Looking at your last email, the error appears to be coming from a call to some IArray variable. This is likely coming from one of the IStringArray variables passed to the solver (e.g., for accumulate attribute names, etc.).&lt;BR /&gt;&lt;BR /&gt;In your code, I notice you have the following:&lt;BR /&gt;&lt;BR /&gt;' Dim AccumulateAttributes As IStringArray 'changed 09_16&lt;BR /&gt;Dim AccumulateAttributes As StrArray&lt;BR /&gt;&lt;BR /&gt;Is there a reason you recently changed this code from using the IStringArray interface? Perhaps this is somehow part of the problem. Can you change the code back to how it was or comment out your use of the accumulate attributes altogether to see if this is the issue?&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Sep 2010 11:24:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/hresult-e-fail-has-been-returned-from-a-call-to-a/m-p/431257#M4097</guid>
      <dc:creator>NagmaYasmin</dc:creator>
      <dc:date>2010-09-21T11:24:59Z</dc:date>
    </item>
    <item>
      <title>Re: HRESULT E_FAIL has been returned from a call to a com component</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/hresult-e-fail-has-been-returned-from-a-call-to-a/m-p/431258#M4098</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Any ideas? Why is it happening only in Arc10? Thanks for any help.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Sep 2010 11:14:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/hresult-e-fail-has-been-returned-from-a-call-to-a/m-p/431258#M4098</guid>
      <dc:creator>NagmaYasmin</dc:creator>
      <dc:date>2010-09-22T11:14:51Z</dc:date>
    </item>
    <item>
      <title>Re: HRESULT E_FAIL has been returned from a call to a com component</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/hresult-e-fail-has-been-returned-from-a-call-to-a/m-p/431259#M4099</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;What is happening in the SetSolverSettings function? Are you calling UpdateContext after changing your solver settings (I don't see any calls to this in your document)? If not, you certainly should be. If you are indeed calling this before calling solve, then I would ask for you to package up your code and maybe a small sample dataset and send it to me to look at. You may reach me at &lt;/SPAN&gt;&lt;A href="mailto:mrice@esri.com"&gt;mrice@esri.com&lt;/A&gt;&lt;SPAN&gt;. If you would rather track this through official channels, then sending this issue to ESRI Technical Support would work as well (and you may be able to get a faster response, as I don't know exactly when I would be able to look into this in further detail [although I will certainly try]).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Sep 2010 16:42:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/hresult-e-fail-has-been-returned-from-a-call-to-a/m-p/431259#M4099</guid>
      <dc:creator>MichaelRice</dc:creator>
      <dc:date>2010-09-22T16:42:13Z</dc:date>
    </item>
    <item>
      <title>Re: HRESULT E_FAIL has been returned from a call to a com component</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/hresult-e-fail-has-been-returned-from-a-call-to-a/m-p/431260#M4100</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Setsolversettings function adds impedance attribute, restrictions, best order. Attached is the SetSolverSettings function. I called updatecontext after calling SetSolversettings, still the same error. The program is pretty big and it is an extension of desktop called Smartr. I will email it to you with data and as well as to esri tech support. Again thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Sep 2010 18:09:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/hresult-e-fail-has-been-returned-from-a-call-to-a/m-p/431260#M4100</guid>
      <dc:creator>NagmaYasmin</dc:creator>
      <dc:date>2010-09-22T18:09:23Z</dc:date>
    </item>
    <item>
      <title>Re: HRESULT E_FAIL has been returned from a call to a com component</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/hresult-e-fail-has-been-returned-from-a-call-to-a/m-p/431261#M4101</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello, Nagma!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'll help Michael look through the code once he gets it from you in email.&amp;nbsp; In the meantime, could you try something else, as well?&amp;nbsp; Before you do the solve, save out the layer as a layer file.&amp;nbsp; It's often easier to see a problem with a layer file in Desktop. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please add this code just before solve:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Dim naLayer As INALayer3 = TryCast(m_pNAContext.Solver.CreateLayer(m_pNAContext), INALayer3)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Dim layerfile As ILayerFile = New LayerFileClass()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; layerfile.[New]("c:\temp\MyLayer.lyr")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; layerfile.ReplaceContents(TryCast(naLayer, ILayer))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; layerfile.Save()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; layerfile.Close()&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Could you send along that layer file as well?&amp;nbsp; Also, what network dataset are you using?&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Sep 2010 14:34:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/hresult-e-fail-has-been-returned-from-a-call-to-a/m-p/431261#M4101</guid>
      <dc:creator>PatrickStevens</dc:creator>
      <dc:date>2010-09-23T14:34:32Z</dc:date>
    </item>
    <item>
      <title>Re: HRESULT E_FAIL has been returned from a call to a com component</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/hresult-e-fail-has-been-returned-from-a-call-to-a/m-p/431262#M4102</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks Michael and Steven. I will send you the data, layer file, .net project and also instruction via email. The network dataset we are using is from our customers. Appreciate your help.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Sep 2010 17:34:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/hresult-e-fail-has-been-returned-from-a-call-to-a/m-p/431262#M4102</guid>
      <dc:creator>NagmaYasmin</dc:creator>
      <dc:date>2010-09-23T17:34:40Z</dc:date>
    </item>
    <item>
      <title>Re: HRESULT E_FAIL has been returned from a call to a com component</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/hresult-e-fail-has-been-returned-from-a-call-to-a/m-p/431263#M4103</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Nagma,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for sending along your data and code.&amp;nbsp; The layer file you sent solves fine when loaded into ArcMap.&amp;nbsp; This means that we need to look further into the code to try and find the problem.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As for the error you get when you access the GPMessages, currently your code is this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; MsgBox("Solve failed " &amp;amp; pGPMessages.Messages.Element(0))&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To avoid the exception you are getting, you could try to loop through the GPMessages:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Dim messageCount As Integer = pGPMessages.Count()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; If (messageCount &amp;lt;&amp;gt; 0) Then &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim gpMessageIndex As Integer&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim stringBuilder As StringBuilder = New StringBuilder()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; For gpMessageIndex = 0 To messageCount - 1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; stringBuilder.Append("GPMessage[" + gpMessageIndex + "]: " + pGPMessages.GetMessage(gpMessageIndex).Description).AppendLine()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Next&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MsgBox("Solve failed." + stringBuilder.ToString())&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Else&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MsgBox("Solve failed without any GPMessages")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; End If&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Sorry if there are any typos in there. I'm a C# developer most of the time.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Sep 2010 23:35:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/hresult-e-fail-has-been-returned-from-a-call-to-a/m-p/431263#M4103</guid>
      <dc:creator>PatrickStevens</dc:creator>
      <dc:date>2010-09-23T23:35:06Z</dc:date>
    </item>
    <item>
      <title>Re: HRESULT E_FAIL has been returned from a call to a com component</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/hresult-e-fail-has-been-returned-from-a-call-to-a/m-p/431264#M4104</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Already found a typo.&amp;nbsp; The line:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For gpMessageIndex = 0 To messageCount&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Should be:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For gpMessageIndex = 0 To messageCount - 1&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Sep 2010 23:37:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/hresult-e-fail-has-been-returned-from-a-call-to-a/m-p/431264#M4104</guid>
      <dc:creator>PatrickStevens</dc:creator>
      <dc:date>2010-09-23T23:37:05Z</dc:date>
    </item>
    <item>
      <title>Re: HRESULT E_FAIL has been returned from a call to a com component</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/hresult-e-fail-has-been-returned-from-a-call-to-a/m-p/431265#M4105</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Steven/Michael,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I added the code and tested with the dataset I sent to you. The message I am getting is that - "Solve required two valid stops". I tested with another dataset, I got message " Solve failed without any GPmessages". But none of them could be solved.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;One more thing, the layer file I sent it to you, I could see only couple of stops, there is no route with that. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Let me know your thoughts.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Sep 2010 16:42:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/hresult-e-fail-has-been-returned-from-a-call-to-a/m-p/431265#M4105</guid>
      <dc:creator>NagmaYasmin</dc:creator>
      <dc:date>2010-09-24T16:42:41Z</dc:date>
    </item>
    <item>
      <title>Re: HRESULT E_FAIL has been returned from a call to a com component</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/hresult-e-fail-has-been-returned-from-a-call-to-a/m-p/431266#M4106</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I added the code and tested with the dataset I sent to you. The message I am getting is that - "Solve required two valid stops".&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Okay, now we are getting somewhere. This means that there is something wrong with one or more of your stops. Either you didn't load in more than one stop, or one of your stops is unlocated or perhaps located on a restricted element (depending on the restrictions you are applying). Is this the exact error message you are getting? I do not think we have an error message in our system that is worded exactly as you have written, but we do have one that is similar: "Need at least 2 valid stops". Can you please verify your exact error message for this case? Also, you should take a look into the data you are loading into your stops and make sure they have valid field values after loading. If they do, and there is more than one stop being loaded, then turn off your restrictions to see if this is what was invalidating some of your stops. If that is the case, then at 10.0, you have the option to avoid locating on restricted elements, which could help. Let me know what you find, and we can proceed from there.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I tested with another dataset, I got message " Solve failed without any GPmessages".&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I assume that you placed Patrick's suggested code in the "catch" part of the try/catch block, correct? Otherwise, if the solve is successful, and there are no GPMessages, then executing Patrick's code outside of the catch block would indeed say "Solve failed without any GPmessages". If this is actually within the catch block, then the solve did throw an error, but did not enter any GPMessages. Try checking the message associated with the actual exception being thrown/caught (this is not in the GPMessages object). Below is some sample VB.NET code for catching and reporting an exception's message:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt; ' Give user information about an exception.&amp;nbsp; 
 Try&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' We will purposely create a File Exception for the&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' purpose of this example. We will be invoking the exception&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' by providing a path of an illegal form.&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim fileContents As String = System.IO.File.ReadAllText("iShouldn'tWork :)")&amp;nbsp; 
 Catch ex As Exception&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' ex.ToString will give the user a large technical dump.&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MessageBox.Show("ToString: " &amp;amp; ex.ToString)&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' ex.Message will give the user a brief, more user friendly error message.&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MessageBox.Show("Message: " &amp;amp; ex.Message)&amp;nbsp; 
 End Try &lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;If you changed datasets, but did not change your solver settings (e.g., impedance name, restriction names, accumulate attribute names, etc.), then these settings may not match appropriately with the attributes available in your other dataset. This may explain this particular error. Please investigate further (as best you can) and let me know.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 19:23:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/hresult-e-fail-has-been-returned-from-a-call-to-a/m-p/431266#M4106</guid>
      <dc:creator>MichaelRice</dc:creator>
      <dc:date>2021-12-11T19:23:04Z</dc:date>
    </item>
    <item>
      <title>Re: HRESULT E_FAIL has been returned from a call to a com component</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/hresult-e-fail-has-been-returned-from-a-call-to-a/m-p/431267#M4107</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Michael,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Sorry for late reply. You are right. The error message is like that "Solve failed. Need at least two valid stops". I was trying to find out why it gives me that error for invalid stops, even it has valid stops loaded. I also added the exception. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The steps I followed:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The progam added a layer in the map with all stops even it couldn't create a route. but it gives me the exception (pls. see the first 2 screenshotof attached document). I tried to solve it right clicking the run from the map and it creates route without any error. Then again I tried to rebuild that route using the program it gives me the message "Solve failed. Need at least two valid stops" . I am not sure whether it makes any sense to you. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It happens to other dataset too. Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Sep 2010 14:43:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/hresult-e-fail-has-been-returned-from-a-call-to-a/m-p/431267#M4107</guid>
      <dc:creator>NagmaYasmin</dc:creator>
      <dc:date>2010-09-28T14:43:48Z</dc:date>
    </item>
    <item>
      <title>Re: HRESULT E_FAIL has been returned from a call to a com component</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/hresult-e-fail-has-been-returned-from-a-call-to-a/m-p/431268#M4108</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Okay, well I can't be sure, but we seem to have at least identified that the problem (at least for part of what you discussed above) appears to be with one or more of your input stops. There could be several possibilities here:&lt;/SPAN&gt;&lt;BR /&gt;&lt;OL&gt;&lt;BR /&gt;&lt;LI&gt;If you are giving each stop a RouteName field value, then it could be that these field values are not identical. If you are trying to assign them to an explicit RouteName, please look at these field values in your loaded layer and make sure these are consistent.&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;If you are assigning time windows to some of your stops, please make sure that these values are valid. For example, the time window start cannot be after your time window end.&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;Your location field values are incorrect for one or more of your stops.&lt;/LI&gt;&lt;BR /&gt;&lt;/OL&gt;&lt;BR /&gt;&lt;SPAN&gt;How are you loading your stops into your layer file before you see this error? If none of these suggestions help, and you are unable to see any potential issues with your stops' field values when you see this error message, then I would advise you to go through ESRI Technical Support, so that we can better track down this problem.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Sep 2010 18:05:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/hresult-e-fail-has-been-returned-from-a-call-to-a/m-p/431268#M4108</guid>
      <dc:creator>MichaelRice</dc:creator>
      <dc:date>2010-09-28T18:05:23Z</dc:date>
    </item>
  </channel>
</rss>

