I am trying to call a method I have written in C# from VBScript.
I have followed just about all of the instructions I can find on the web and am still having problems.
Specifically I am getting
Error: ActiveX component can t create object
Code: 800A01AD
So far I have done the following:
- Set
ComVisible(true)
- Registered using
regasm /codebase
- Strong named my assembly
- Confirmed it is in the registry and points to the correct location
- Made the class public
- Have no static methods
- Made the method I want to call public
- Have a parameterless constructor
- Explicitly defined a GUID
My VBScript looks like this:
set oObject = CreateObject("TTTTTT.FFFFF.CCCCCCCCC")
My C# code looks like this:
using System;
using System.IO;
using System.Windows.Forms;
using System.Runtime.InteropServices;
namespace XXXXX.YYYYY
{
[ComVisible(true)]
[Guid("3EB62C37-79BC-44f7-AFBD-7B8113D1FD4F")]
[ProgId("TTTTTT.FFFFF.CCCCCCCCC")]
public class CCCCCCCCC
{
public void MyFunc()
{
//
}
}
}
Can anyone help?