tags:

views:

49

answers:

1

Okey here's the situation: I've got a microsoft excel macro in vb that I want to call using C#. I've already tried creating a workbook using Microsoft.Office.Interop.Excel, however I don't want to have to run an excel process to run the macro.

So then I thought why not make a vb class library with my code in it so i can still run it and have a clean dll file. It's not needed to keep any sheet related functions since the macro reads a .lua(UTF-8)text file with some advanced regex functions that I just can't get recreated in C#.

Is it possible for me to make the library use interop as well so i can just call the function in my C#? Any examples would be greatly appreciated.

A: 

First I assume you are working with VB6 and not VB Script?

I have never worked with VB 6 or earlier, but I think your best be will be to create a COM object and then you can call the COM object from .NET using C#. Here is a quick link I found through BING that I believe will help you get started if this in an option for you.

Walkthrough: Implementing Inheritance with COM Objects (Visual Basic)

Chris Taylor
Yes it's VBA which is a slightly different version of VB 6 I'll have a look and tell you how things work out.
OhBugger
@OhBugger, I thought you might be refering to VBA, but when you mentioned creating a class library I thought you might be refering to VB6. Well good luck.
Chris Taylor