F #, problems with IntelliSense and Office

I am trying to write Office automation code and I cannot get IntelliSense help for Office PIA types. It is strange that it works fine in C #, as well as in Tutorial.vs2010 F # Solution with some code of the same code.

I am using VS10 and PIA for Office 14.

enter image description here

VS

enter image description here

Any ideas?

+4
source share
2 answers

I forgot to include a link to Office.dll. This seems to fix the problem.

+4
source

For those who find this later, but cannot figure out where office.dll , like me. I ran into the same issue with F # 4.0, Office 2013 and VS Community 2015 Update 2.0

I typed this at the beginning of the file to get Intellisense to work, there is no need to look for office.dll in your machine:

 #r "office, Version = 15.0.0.0" 

This is the same text that it gives with <Note> , but without Culture=neutral and PublicKey=w/e . It seems to work flawlessly.

In context, this is how my file starts:

 #r "Microsoft.Office.Interop.Excel" #r "office, Version = 15.0.0.0" open System open System.IO open System.Reflection open Microsoft.Office.Interop.Excel let app = ApplicationClass(Visible = true) let sheet = app.Workbooks .Add() .Worksheets.[1] :?> _Worksheet 
0
source

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


All Articles