After adding the reference to the interop.office.Excel.dll in VS2015, F# (4.0, .net 4.6.1) still not able to recognizing the type under the Excel.dll.
The reference to the Excel.dll looks like
As a comparison, i created a C# project with same reference there is no issue finding the reference.
Strangely, the F# code does compile, if reference the workbook object under the excel dll. (i just have to treat it as if it was a dynamic type) only the intellisense is not working.
any suggestion? thanks
Most probably (just as the error message says), you need to add a reference to the office.dll (in FSI or in the VS's References). There can be various versions of excel and office installed, so I just assume you're using Excel 2010 (which is Ver 14). In that case to make it explicit:
#r @"C:\Program Files (x86)\Microsoft Visual Studio 14.0\Visual Studio Tools for Office\PIA\Office14\Microsoft.Office.Interop.Excel.dll"
#r @"C:\Program Files (x86)\Microsoft Visual Studio 14.0\Visual Studio Tools for Office\PIA\Office14\Office.dll"
open Microsoft.Office.Interop.Excel
let xlApp = new ApplicationClass(Visible = true)
xlApp.
xlApp
will now have intellisense:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With