Re: Re: Linking to Mathematica Kernel from Excel
- To: mathgroup at smc.vnet.net
- Subject: [mg59618] Re: [mg59594] Re: Linking to Mathematica Kernel from Excel
- From: Murray Eisenberg <murray at math.umass.edu>
- Date: Sun, 14 Aug 2005 04:38:05 -0400 (EDT)
- Organization: Mathematics & Statistics, Univ. of Mass./Amherst
- References: <200508100658.CAA04724@smc.vnet.net><ddf5bp$ol0$1@smc.vnet.net> <200508130726.DAA00913@smc.vnet.net>
- Reply-to: murray at math.umass.edu
- Sender: owner-wri-mathgroup at wolfram.com
After re-installing Mathematica Link for Excel to work with Mathematica 5.2, everything is working EXCEPT: I cannot Set a value, say var = 5, in the Mathematica front end (using the Multilink kernel) and then fetch its value in an Excel spreadsheet via a =Math("var") expression. I can, however, send Mathematica expressions from the spreadsheet to be evaluated in the Mathematica kernel otherwise. Also, MLX.xla is not loading automatically; I thought it should. Further, although I can seem to launch a Mathematica link from Excel, I'm not getting the expected start-up dialog to select a kernel. Anybody know how to fix this? This is with Mathematica 5.2, as I said, and Excel 2003 under Windows XP Professional (SP2). I DID install the latest posted MLX.xla update (the one that's listed as "Windows Version 2.2" at support.wolfram.com/applicationpacks/excel_link/update.html). stevekass at gmail.com wrote: > Murray, > > Can you verify that "Mathematica Link for Excel" works correctly with > recent versions of Mathematica? > > I just tried installing Episoft's other offering, Mathematica for > ActiveX, and it is not working. The files in that product are all > dated from 1996-2000, and I want to find out if it still works. > > If you are using it successfully, can you mention whether you are doing > this via a network license for Mathematica? I'm getting a $NoLink > result, which suggests that Episoft's product and NetworkMathematica > aren't playing well together. > > Steve Kass > Drew University > skass at drew.edu > > Murray Eisenberg wrote: > >>If you'd rather pay than play, you could use the Wolfram add-on >>application "Mathematica Link for Excel". See: >>http://www.wolfram.com/products/applications/excel_link/ >> >>plizak wrote: >> >>>I'm trying to write code to link to Mathematica automatically from >>>within MS Excel. Here is the code I have so far (below - It's VBA >>>code). >>> >>>It does not work when I first open Excel, but if I have already >>>connected to the kernel prior and want to reconnect then it works. Do >>>I have to point to the location of the kernel? If so how? >>> >>>Also, Am I clearing variables properly? What command should I use in >>>Mathematica to clear all variables??? >>> >>>Thanks in advance, >>>Peter >>> >>>------ VBA code below -------------------------------------------- >>> >>> >>> >>>' If there is an error, go to "deal" >>>On Error GoTo deal >>> >>> result = Application.Run("Mathematica", "$Version") >>> Debug.Print result >>> >>> ' If there is no link, then connect to the Kernel >>> If result = "$NoLink" Then >>> ' Connect to the mathematica Kernel >>> Debug.Print "Connecting to Mathematica" >>> Application.Run "LinkOpenOrClose" >>> >>> ' If there is a link already, clear all variables >>> Else >>> ' Clear the contents of the mathematica kernel >>> Debug.Print "Clearing Memory" >>> FunInput = "Clear[ ""Global `*""]" >>> result = Application.Run("Mathematica", FunInput) >>> Debug.Print result >>> End If >>> >>> ' check the version just to make sure we have a link >>> result = Application.Run("Mathematica", "$Version") >>> >>> If result = "$NoLink" Then >>> MsgBox ("Error connecting to Mathematica Kernel. Please verify >>>Mathematica is installed and available and please try again.") >>> End If >>> >>> >>> Exit Sub >>> >>>' do the following if we encounter an error >>>deal: >>> >>> Debug.Print "Error Linking Mathematica: Error # ", Err >>> If Err = 1004 Then >>> result = Application.Run("Mathematica", "LinkOpenOrClose") >>> End If >>> >>> >> >>-- >>Murray Eisenberg murray at math.umass.edu >>Mathematics & Statistics Dept. >>Lederle Graduate Research Tower phone 413 549-1020 (H) >>University of Massachusetts 413 545-2859 (W) >>710 North Pleasant Street fax 413 545-1801 >>Amherst, MA 01003-9305 > > > -- Murray Eisenberg murray at math.umass.edu Mathematics & Statistics Dept. Lederle Graduate Research Tower phone 413 549-1020 (H) University of Massachusetts 413 545-2859 (W) 710 North Pleasant Street fax 413 545-1801 Amherst, MA 01003-9305
- References:
- Linking to Mathematica Kernel from Excel
- From: "plizak" <plizak@gmail.com>
- Re: Linking to Mathematica Kernel from Excel
- From: stevekass@gmail.com
- Linking to Mathematica Kernel from Excel