title: SUMIFS using two Workbooks - Run-time Error "13"
body: <p>This is my first post on Stack Overflow.. I've used this site multiple times with my VBA questions and most of the time, I've been able to find the answer. This time, however, I'm finding that I can't locate anything that helps me out. I've tried to figure out this problem from multiple angles and I can't seem to figure it out. I've gotten this SUMIFS code to work correctly using a single Workbook, but two presents a problem. The two sheets are "ActiveHedge.xlsm" and "LiveDataFeed.xlsm" and here is my code:</p>
  
  <pre><code>Sub Call_LiveDataFeed()
  Workbooks.Open Filename:="Z:\Users\toms\Desktop\LiveDataFeed.xlsm"
  End Sub
  Sub CreateFNMA_MonthlyCoupons()
  Workbooks("LiveDataFeed.xlsm").Activate
  Range("D7").Formula = _
      "=SUMIFS('[ActiveHedge.xlsm]Active Hedge'!$I:$I,'[ActiveHedge.xlsm]Active Hedge'!$H:$H,"&gt;="&amp;U9,'[ActiveHedge.xlsm]Active Hedge'!$I:$I,"&lt;="&amp;V9,'[ActiveHedge.xlsm]Active Hedge'!$K:$K,"&lt;"&amp;C5-14)"
  </code></pre>
  
  <p>So, I used &amp; before the Cell references in the criteria range due to the first two criteria being decimals that will change on the "LiveDataFeed.xlsm" sheet and the final criteria is the date entered in the cell, minus 14 days; the inputted date will change as well.</p>
  
  <p>I found that the SUMIFS function, as entered above, works perfectly fine as a function entered directly into a worksheet in the "LiveDataSheet.xlsm" workbook. However, when put in to VBA, it has a Run-Time Error "13"... My solution to this for using one workbook, was simply to put an extra " " around my >= , &lt;= and &lt;... This isn't working now... Any help would be much appreciated!</p>