0

It is my first post here so Hi everyone. I have a problem with code in VB.NET

I have this line:

WorksheetFunction.CountA(ExWorkSheet.Range("A1:C65536"))

And compiler told me that: 'WorksheetFunction' is not declared. It may be inaccessible due to its protection level

I also tried that:

Application.WorksheetFunction.CountA(ExWorkSheet.Range("A1:C65536"))

Then the error is: 'WorksheetFunction' is not a member of 'System.Windows.Forms.Application' Thank for any help

Raven2946
  • 17
  • 4
  • You must either create an Excel Add-In or at least reference the Excel COM Interop. For more info see: https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/interop/walkthrough-office-programming – Visual Vincent Jul 05 '17 at 09:19
  • Here's how you can reference the COM Interop: https://stackoverflow.com/a/15285939/3740093 – Visual Vincent Jul 05 '17 at 09:24

0 Answers0