Dear all
We are trying to implement and control Bayes’sian Networks in Excel by using the supported Smile.NET. In a first step we added the smilenet.dll in a VBA-Project so that should be able to use smile in Excel. To getting started it would be very helpful if somebody could give us a small example for implementing a network in Excel. The following points are of special interest for the first steps:
• to load a network
• to set evidence in nodes
• to compile and save a network.
Thank you very much for your help in advance and best regards
Matthias
Using SmileNet in Excel
-
- Site Admin
- Posts: 1443
- Joined: Mon Nov 26, 2007 5:51 pm
Re: Using SmileNet in Excel
Are you able to instantiate Smile.Network object in your VBA project?
I think this is exactly our problem...
I can add the smileNet.dll as a ressource to the project, but I'm not able to create a Smile.Network object.
I tried following code:
Sub loadNet()
Dim net As New smileNet.Network
net.readfile ("C:\Test_Net.xdsl")
End Sub
The excel debuger shows no error but if I execute this code I reciece the following error message:
Run-time error '-2146233079(80131509)'
Automation error
I can add the smileNet.dll as a ressource to the project, but I'm not able to create a Smile.Network object.
I tried following code:
Sub loadNet()
Dim net As New smileNet.Network
net.readfile ("C:\Test_Net.xdsl")
End Sub
The excel debuger shows no error but if I execute this code I reciece the following error message:
Run-time error '-2146233079(80131509)'
Automation error
-
- Site Admin
- Posts: 1443
- Joined: Mon Nov 26, 2007 5:51 pm
I was able to reproduce the problem, but I'm not sure if I'll be able to solve it within reasonable timeframe.mathias wrote:I think this is exactly our problem...
I can add the smileNet.dll as a ressource to the project, but I'm not able to create a Smile.Network object.
What about Plan B: using SmileX - the plain, old COM component? It should be easily consumable from Excel . I can build it using most recent SMILE sources and we even have the old docs still online.
-
- Site Admin
- Posts: 1443
- Joined: Mon Nov 26, 2007 5:51 pm
Using SMILE in Excel
I would like to use SMILE in Excel. I have read in this post that one must use the ActiveX control (SMILEX).
Is it yet possible to use Smile.NET in conjunction with Excel? If so, I am not quite sure how to get started. Can anyone please give me some direction?
If SMILEX still needs to be used, does anyone know why I am unable to register the control in the new Excel 2007? I am able to register and use the control in an old version of Excel but have not success in the new version.
Any help would be greatly appreciated.
Thank you VERY much.
Is it yet possible to use Smile.NET in conjunction with Excel? If so, I am not quite sure how to get started. Can anyone please give me some direction?
If SMILEX still needs to be used, does anyone know why I am unable to register the control in the new Excel 2007? I am able to register and use the control in an old version of Excel but have not success in the new version.
Any help would be greatly appreciated.
Thank you VERY much.
-
- Site Admin
- Posts: 1443
- Joined: Mon Nov 26, 2007 5:51 pm
Re: Using SMILE in Excel
This may be good starting point if you want to use .NET:Shelby wrote:I would like to use SMILE in Excel. I have read in this post that one must use the ActiveX control (SMILEX).
Is it yet possible to use Smile.NET in conjunction with Excel? If so, I am not quite sure how to get started. Can anyone please give me some direction?
http://richnewman.wordpress.com/2007/04 ... rom-excel/
I can't guarantee that Smile.NET will work with Excel, though.
You need to call regsvr32 on smilex.ocx first. Excel 2007 doesn't list SmileX in the 'References' dialog box, so you'll have to click 'Browse' button and select the location of smilex.ocx file manually. This will add the required reference to your Excel VBA project and you should be able to instantiate SmileX object and call its methods, like this:If SMILEX still needs to be used, does anyone know why I am unable to register the control in the new Excel 2007?
Code: Select all
Sub xyz()
Dim s As New SmileX
s.ReadFile ("d:\directory\network.xdsl")
MsgBox s.NetworkID
End Sub
Re: Using SmileNet in Excel
Dear members of the forum,
dear shooltz
We are still trying to use the smilenet.dll in connection with Microsoft Excel (see also my post from Mon Jan 21, 2008 11:31 am)
The needs emerge to use the full functionality of smilenet.dll and we made another attempt to use it in Excel. Presently we still use the old smileX .ocx component.
We tried to follow the the reference shooltz gave in the forum on (Fri Sep 12, 2008 10:39 am)
http://richnewman.wordpress.com/2007/04 ... rom-excel/
The remaining problem is that we are still not able to add the dll as a resource to Excel.
One aspect migth be that smilenet.dll is not compiled for the use in Excel (interop, COM interface).
Was anybody able to use the smilenet.dll in Micosoft Excel VBA? Is there a possibility that the smilenet.dll is compiled for the use in Excel.
We appreciate any help in that direction.
Thank you and best regards
matthias
dear shooltz
We are still trying to use the smilenet.dll in connection with Microsoft Excel (see also my post from Mon Jan 21, 2008 11:31 am)
The needs emerge to use the full functionality of smilenet.dll and we made another attempt to use it in Excel. Presently we still use the old smileX .ocx component.
We tried to follow the the reference shooltz gave in the forum on (Fri Sep 12, 2008 10:39 am)
http://richnewman.wordpress.com/2007/04 ... rom-excel/
The remaining problem is that we are still not able to add the dll as a resource to Excel.
One aspect migth be that smilenet.dll is not compiled for the use in Excel (interop, COM interface).
Was anybody able to use the smilenet.dll in Micosoft Excel VBA? Is there a possibility that the smilenet.dll is compiled for the use in Excel.
We appreciate any help in that direction.
Thank you and best regards
matthias