Using SmileNet in Excel

The engine.
Post Reply
Matthias
Posts: 5
Joined: Sun Jan 20, 2008 12:44 pm

Using SmileNet in Excel

Post by Matthias »

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
shooltz[BayesFusion]
Site Admin
Posts: 1443
Joined: Mon Nov 26, 2007 5:51 pm

Re: Using SmileNet in Excel

Post by shooltz[BayesFusion] »

Are you able to instantiate Smile.Network object in your VBA project?
mathias
Posts: 1
Joined: Mon Jan 21, 2008 1:53 pm

Post by mathias »

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
shooltz[BayesFusion]
Site Admin
Posts: 1443
Joined: Mon Nov 26, 2007 5:51 pm

Post by shooltz[BayesFusion] »

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.
I was able to reproduce the problem, but I'm not sure if I'll be able to solve it within reasonable timeframe.

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.
Matthias
Posts: 5
Joined: Sun Jan 20, 2008 12:44 pm

Post by Matthias »

This would be a very good option for now.
If it is possible we would really like to get the newest version compiled - that would solve our problem for the moment.

Thank you for this perfect support!

Matthias
shooltz[BayesFusion]
Site Admin
Posts: 1443
Joined: Mon Nov 26, 2007 5:51 pm

Post by shooltz[BayesFusion] »

The refreshed SmileX is online. Good luck!
Meggsico
Posts: 3
Joined: Sat Mar 15, 2008 2:54 pm

Post by Meggsico »

Thx, i took this. It is good for me.
Shelby
Posts: 2
Joined: Fri Sep 12, 2008 2:34 am

Using SMILE in Excel

Post by Shelby »

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.
shooltz[BayesFusion]
Site Admin
Posts: 1443
Joined: Mon Nov 26, 2007 5:51 pm

Re: Using SMILE in Excel

Post by shooltz[BayesFusion] »

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?
This may be good starting point if you want to use .NET:
http://richnewman.wordpress.com/2007/04 ... rom-excel/

I can't guarantee that Smile.NET will work with Excel, though.

If SMILEX still needs to be used, does anyone know why I am unable to register the control in the new Excel 2007?
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:

Code: Select all

Sub xyz()
    Dim s As New SmileX
    s.ReadFile ("d:\directory\network.xdsl")
    MsgBox s.NetworkID
End Sub
Matthias
Posts: 5
Joined: Sun Jan 20, 2008 12:44 pm

Re: Using SmileNet in Excel

Post by Matthias »

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
Post Reply