vb.net 2010 dll trying to run from VBScript
-
Wednesday, January 11, 2012 8:57 AM
Hi,
I've created simple DLL (Testing purpose) with VB.NET 2010, I'm able to access this from inside my VB.net 2010 environment using "UserControl", and works fine. If I create new project, and reference the DLL that also works fine
I've registered it using RegAsm.exe <Dll path> /codebase for running from VBScript however when runnnig the script I get following error message "Object doesn't support this property or method 'Sayhello'
VBscript code
Dim FSO, oShell, oDLL
Set FSO = CreateObject("scripting.filesystemobject")
Set oShell = CreateObject("wscript.shell")
Set oDLL = CreateObject("TestDLL.DLLCtrl")oDLL.SayHello()
DLL Code (VB.NET)
Public
Class
TestDLL
Public Shared Sub
SayHello()
MsgBox(
"Hello from DLL"
)
End
Sub
End
Class
VB.NET I've made sure that
"Make Assembly-Com visible is ticked
Register for com-interop also ticked.
I've done this before with Visual Studio 2008 and was working fine, but don't seem to get this working on Visual studio 2010.
any advice, suggestions appreciated.
All Replies
-
Thursday, January 12, 2012 2:57 PMModerator
Hi Denis,
Welcome to the MSDN Forum.
Here is a similar thread: http://social.msdn.microsoft.com/Forums/en-AU/netfxbcl/thread/67b7b9a4-ce0d-400e-a705-8e3b3a864f37
Please take a look at it.
In addition, the first thing you need to confirm is: your VB.net DLL is OK.
And then, there is a official forum for VBS issues: http://social.technet.microsoft.com/Forums/en/ITCG/threads/
So you can try to ask your issue on that forum.
Anyway, I recommend you check the following points:
1. When you use Regasm tool to register the DLL, did you add /codebase switch? If not, please add it and try again.
2. Did you use the corresponding Regasm to register your dll? I mean, if you develop the dll in .net framework 4.0, did you use the regasm which its version is 4.0? If not, please use the corresponding tool.
Best regards,
Mike Feng
MSDN Community Support | Feedback to us
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
- Marked As Answer by Mike FengMicrosoft Contingent Staff, Moderator Friday, January 27, 2012 10:01 AM
-
Wednesday, January 18, 2012 3:28 PMModerator
Hi Denis,
Do you have any updates?
How about your question now?
Best regards,
Mike Feng
MSDN Community Support | Feedback to us
Please remember to mark the replies as answers if they help and unmark them if they provide no help.

