tags:

views:

42

answers:

1

I am using office 2007 excel work sheet function in c# code. VS2010 issues this warning

Warning 3 Ambiguity between method 'Microsoft.Office.Interop.Excel._Worksheet.Activate()' and non-method 'Microsoft.Office.Interop.Excel.DocEvents_Event.Activate'. Using method group. D:\EXLANEDB01p\dev\libraries\EXCEL\Excel.cs 531 95 EXCEL How do I resolve this ? the call is

xSheet.Activate(); where xSheet passed as ref in the call as ref Microsoft.Office.Interop.Excel.Worksheet xSheet

+1  A: 

Perhaps cast your object to Microsoft.Office.Interop.Excel._Worksheet first then call Activate()?

((Microsoft.Office.Interop.Excel._Worksheet)xSheet).Activate();
Jeff M
Thanks .. that resolved the waringing..Tony
TonyP