How to open Excel sheet in a Strategy?
Author: sedelstein
Creation Date: 11/8/2015 11:36 PM
profile picture

sedelstein

#1
I'm trying to use excel for some functionality that would be handy in a script

I know the line of C# I need in the script is

CODE:
Please log in to see this code.


and I've downloaded and installed these interop libraries but can't seem to find the .dll's I need to reference.

Has anyone done this and can point me in the right direction?

Thanks!
profile picture

Eugene

#2
You might want to start by reading this FAQ:

Is there a way to read/write values to an open Excel sheet?
profile picture

sedelstein

#3
Thanks Eugene

I've tried, in the editor, to add a reference but Excel/Office is not listed under .Net Framework or Other Assemblies to Reference so I cannot see the COM object. Does this mean that I have to run WL under Visual Studio as I would if I was debugging a strategy or is there a way to do it from the editor?

profile picture

Eugene

#4
You need to reference not the COM object but its .NET wrapper DLL file.
profile picture

sedelstein

#5
Thanks.

By chance, do you happen to know the name of this DLL file. That's really the only issue I have and if you know, it would help me enormously (and perhaps other readers of this thread)

profile picture

Eugene

#6
Last time I worked with Excel was 10 years ago so I don't know for sure. OpenOffice/Google Drive is a perfect replacement for me. I guess it's called Microsoft.Office.Interop.Excel.dll and appears after installing "Office Primary Interop Assemblies" (included with MS Office). To find its location on your PC please follow post #2 and below (not the accepted answer):

What reference do I need to use Microsoft.Office.Interop.Excel in .NET?
profile picture

sedelstein

#7
Thanks Eugene.

This "should" do the trick.

I've followed steps correctly after downloading the Primary Interop assemblies but just can't determine where the files are located.

I'll follow up when found.

profile picture

Eugene

#8
1. They have to be installed into the GAC by the installer, not just 'downloaded'.
2. I'm not sure but their bitness (32/64-bit) may have to match Wealth-Lab's bitness.
3. Not sure again but to get there you may need to enable hidden file/folder visibility in Windows Folder Options.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).