F # does not recognize interop.office.Excel.dll

After adding a link to interop.office.Excel.dll in VS2015, F # (4.0, .net 4.6.1) still failed to recognize the type under Excel.dll.

enter image description here

Link to excel.dll file looks like

enter image description here

For comparison, I created a C # project with the same link, there is no problem finding the link.

Strange, the F # code compiles if it refers to a workbook object under excel dll. (I just have to treat it as if it were a dynamic type), only intellisense is not working.

any suggestion? thank

+4
source share
1 answer

( ), office.dll( FSI VS). Excel Office, , Excel 2010 ( Ver 14). :

#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 intellisense:

enter image description here

+2

Source: https://habr.com/ru/post/1651613/


All Articles