本文整理汇总了C#中Microsoft.Office.Interop.Excel.Calculate方法的典型用法代码示例。如果您正苦于以下问题:C# Microsoft.Office.Interop.Excel.Calculate方法的具体用法?C# Microsoft.Office.Interop.Excel.Calculate怎么用?C# Microsoft.Office.Interop.Excel.Calculate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.Office.Interop.Excel
的用法示例。
在下文中一共展示了Microsoft.Office.Interop.Excel.Calculate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: checkDuplicate
bool checkDuplicate(Excel._Worksheet xlWorksheet, string companyName, string companyPhone, string companyEmail,
string companyWebsite)
{
Excel.Range xlRange = xlWorksheet.UsedRange;
xlRange.Cells[13, 3].Value2 = companyName;
xlRange.Cells[13, 4].Value2 = companyPhone;
xlRange.Cells[13, 5].Value2 = companyEmail;
xlRange.Cells[13, 6].Value2 = companyWebsite;
xlWorksheet.Calculate();
string duplicateCheckName = (string)(xlRange.Cells[15, 3] as Excel.Range).Value2;
string duplicateCheckPhone = (string)(xlRange.Cells[15, 4] as Excel.Range).Value2;
string duplicateCheckEmail = (string)(xlRange.Cells[15, 5] as Excel.Range).Value2;
string duplicateCheckWebsite = (string)(xlRange.Cells[15, 6] as Excel.Range).Value2;
if (/*duplicateCheckName == "DUPLICATE!!" || */ /* Took out check company name, it sucks */
duplicateCheckPhone == "DUPLICATE!!" ||
duplicateCheckEmail == "DUPLICATE!!" ||
duplicateCheckWebsite == "DUPLICATE!!")
{
textDebugger.AppendText("Lead dupe excel found: " + String.Concat(companyName, ",", companyEmail, ",", companyWebsite)
+ Environment.NewLine);
return true;
}
else return false;
}