This isn't specific to Office; adding a reference to your project does not affect FSI - you need to use an "#r" directive. Typically, I'd put something like this into my file:

1
2
3
#if INTERACTIVE
    #r "Microsoft.Office.Interop.Excel"
#endif

FSI is smart enough to find the file, so you don't have to provide the full path.

By on 10/21/2010 8:29 AM ()

Thanks for your help everyone. Seems that all I needed to do was add kvb's snippet to the top of my input file. I also needed a double semicolon for fsi not to complain about #r statement.

1
2
3
#if INTERACTIVE
    #r "Microsoft.Office.Interop.Excel";;
#endif

I can now control excel from F#.

I should also note that I have installed the latest office PIA (primary interface assembly) but I don't know if this was necessary.

By on 10/22/2010 1:49 AM ()

Hi,

I'm no office developer and I only use those stuff rarely but there is something called "Visual Studio Tools For Office" that should come with all you need.

Problem is: I don't remember if this is only part of VS2010 pro, prem. or ultimate or if you can download it for free.

If you google a bit you will find the tools for the runtime but I don't know if that contains all you need. Here is a link to the tools home: [link:msdn.microsoft.com]

By on 10/21/2010 6:58 AM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us
Built with WebSharper