none
Can't create object when using wscript.createobject("my.object","_myobject") loading my c# com RRS feed

  • Question

  • I'm trying to create a com object in c# that will be loaded in vbscript.

    I can call my dll from another c# application and can call it from vbscript if I use wscript.createobject("my.object"), but when I try call it using wscript.createobject("my.object","_object") to capture events I get "Could not create object named "my.object"  Code: 80131040"

    Thursday, November 22, 2018 6:38 PM

All replies

  • Hi Peter Viau,

    Please check if it the com object is registered in your registry by making a lookup in the registry. HKEY_CLASSES_ROOT\yourcom.component.

    Best regards,

    Zhanglong


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, November 23, 2018 5:26 AM
    Moderator
  • My com object is there
    Friday, November 23, 2018 12:39 PM
  • Hi Peter Viau,

    Please check if you mark your assembly as COM visible by setting the COMVisibleAttribute to true. 

    Here is an article about How to Call a .NET DLL from a VBScript for your reference.

    https://www.codeproject.com/Articles/79314/How-to-call-a-NET-DLL-from-a-VBScript

    Best regards,

    Zhanglong


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, November 26, 2018 7:36 AM
    Moderator
  •  [ComVisible(true)] is set in my assembly.

    I can call functions in my vbscript by using "Set Prompt = WScript.CreateObject("fehelper.Operations")" but if I want to capture events by using "Set Prompt = WScript.CreateObject("fehelper.Operations","_fehelper") I get the errors

    Monday, November 26, 2018 2:15 PM
  • Hi Peter,

    According to your description, it seems that it is not a C# issue, it is a VBSCIPT issue, I would suggest that you could post your issue on VBScript forum for suitable support

    http://www.vbforums.com/forumdisplay.php?4-ASP-VB-Script

    Thanks for your understanding.

    Best regards,

    Zhanglong


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, November 27, 2018 6:11 AM
    Moderator
  • I disagree, Vbscript is doing what's it's supposed to.
    Tuesday, November 27, 2018 12:05 PM
  • Hi Peter Viau,

    As you said, it works with only one parameter, so I think that c# com dll works. and I am not sure what's the usage of the second parameter of the method named wscript.createobject. Is there some settings or configuration causing the issue.

    Best regards,

    Zhanglong


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, November 29, 2018 5:40 AM
    Moderator