title: How do you reference cells in another workbook using an excel formula for Color Formatting?
body: <p>I have two worksheets from different workbooks: one I am editing (xlwkstTempSummary), and one from which I want to compare values (xlwkstSummary). I want to apply a background color to a single column in the temporary sheet based on the values from the imported sheet. Here is a snippet of my current code:</p>
  
  <pre><code>Excel.Workbook xlwkbkImport = books.Open(file_location,misValue, true, 
      misValue, misValue, misValue, true, misValue, misValue, misValue, false, 
      misValue, misValue, misValue, 0);
  
  Excel.Sheets sheets = xlwkbkImport.Worksheets;
  Excel.Worksheet xlwkstSummary = (Excel.Worksheet)sheets.get_Item(1);
  
  Excel.Range r = xlwkstTempSummary.get_Range("F" + summary_start_row.ToString(), "F" + (summary_start_row + clinic_row_count - 1).ToString());
  string file_name = file_location.Name;
  string file_directory = Path.GetDirectoryName(file_location);
  Excel.FormatConditions r_format = r.FormatConditions;
  
  Excel.FormatCondition c1 = r_format.Add((Excel.XlFormatConditionType)2) /*format based on expression*/,
                  misValue,
                  @"=AND(AND($G" + summary_start_row + @"&lt;&gt;""4 Star"", $G" + 
                  summary_start_row + @"&lt;&gt;""5 Star"", $G" +
                  summary_start_row + @"&lt;&gt;""75th"", $G" + 
                  summary_start_row + @"&lt;&gt;""90th""), $F" +
                  summary_start_row + @"&lt;VLOOKUP($C" + summary_start_row + 
                  @",'" + file_directory + @"[" + file_name + @"]Summary'!$A$9:$D$41,4,FALSE))", 
                  misValue, misValue, misValue, misValue, misValue); 
  Excel.Interior c1_interior = c1.Interior;
  c1_interior.Color = Color.FromArgb(216, 49, 49); //Red
  </code></pre>
  
  <p>I am currently using a vlookup to get the value I need from the imported sheet, and the expressions work fine when written in directly in excel, but when I run the program, I get the following error:</p>
  
  <p><strong>System.ArgumentException: The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))
     at System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData&amp; msgData)</strong></p>
  
  <p>The only reason I can think of for it failing is failing to properly resolve the name of the imported workbook in my vlookup call. Could someone more familiar with the Microsoft.Office.Interop.Excel library shed some light on this issue?</p>