Can't instantiate a COM object written in C# from VBA (VB6 ok)

后端 未结 5 2040
小鲜肉
小鲜肉 2020-12-08 23:41

Using VS 2008, here is my COM object

using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;
using System.Wi         


        
5条回答
  •  北荒
    北荒 (楼主)
    2020-12-09 00:13

    I'm going to answer my own question, hopefully to spare others the hours of tedious drudgery I have just endured.

    If you get this, it is because the .NET based COM assembly can't find the .NET framework

    The solution is simple. Create a file containing the following

    
    
      
       
      
    
    

    Call it "Excel.Exe.Config" and place it in the same directory as "EXCEL.EXE"

    Problem solved!

提交回复
热议问题