Giter VIP home page Giter VIP logo

Comments (8)

PGS62 avatar PGS62 commented on July 25, 2024

I don't think you're "missing a step". What appears to be happening is that the install script is failing quite early, at the point when it's trying to detect whether or not Excel is already running. The offending code is a method called CheckExcel that calls a method IsProcessRunning that I think I cribbed from this StackOverFlow post.

Here's a very hacky solution that might work:

  1. Ensure that Excel is really not running - preferably using TaskManager to check that no "ghost" Excel process is running.
  2. Open C:\Users\Christopher Hampel.julia\packages\JuliaExcel\Y1cgX\Installer\install.vbs
    (which is a copy of this file) in a text editor.
  3. Comment out line 458 (a call to CheckExcel) by typing a single quote character at the start of the line.
  4. Save the file.
  5. Run the amended file by double-clicking it in file explorer.

Good luck!

from juliaexcel.jl.

chris-hampel-CA avatar chris-hampel-CA commented on July 25, 2024

Thanks for the suggestion @PGS62 . I attempted this after a restart of my computer, with no instance of Excel showing in the Task Manager, and found a new error occurring

image

Can you verify that line 458 is the correct line to make the comment on? I used the single quote to comment next to the beginning of the text in line 458.

image

from juliaexcel.jl.

PGS62 avatar PGS62 commented on July 25, 2024

Ah sorry, I must have been looking at an out of date copy of install.vbs. You should comment out line 449.

image

from juliaexcel.jl.

chris-hampel-CA avatar chris-hampel-CA commented on July 25, 2024

Ok thanks. Your suggestion for commenting out line 449 allowed me to complete the installation successfully! I don't know if this is a global issue or just local to me. I will let you decide how you want to handle it going forward. The issue can certainly be closed.

Also, while I have you here, I have two more quick questions about this tool (as I'm really excited to use this in hopes to allow non-coders to interface with julia tools that I work on)

  1. I want to make julia functions that are specific to a project available to be called with JuliaCall. I originally added the JuliaExcel package to a project env and did the installation; however, when opening Excel, I could only call =JuliaLaunch() successfully if I added the JuliaExcel package to my base env. How can I launch a JuliaExcel session in Excel such that it calls julia in a project env?
  2. Also in testing this, I noticed that if I run some simple =JuliaEval() expressions when working in my base env, the correct outputs appear in Excel as expected, but when I close and re-open the same file, the outputs go away. They re-appear if we launch julia again and press enter again in all the cells with JuliaEval calls. My question: is there a way to make the julia outputs stay visible when re-opening Excel such that a JuliaEval expression can be evaluated only once? My use case is: I want to call a function that runs a model and displays the resulting data such that when I close Excel and re-open, my previous model run's data is still available for viewing. The data could then only be overwritten by re-launching Julia and evaluating the expressions again. (I realize you can turn calculations to MANUAL in Excel after finishing your julia function evals, close and re-open and the data will still be there as I want. This seems like a work around, but I am curious if there is a more advanced feature that I may not be aware of.)

Thanks, Chris

from juliaexcel.jl.

PGS62 avatar PGS62 commented on July 25, 2024

The failure of the installer script on your PC was a surprise to me - I'd not seen that before. Is your PC "locked down" in some way, perhaps by a corporate IT department (anti-virus etc.)?

In answer to your questions:

  1. JuliaLaunch has a CommandLineOptions argument. I think that you should be able to pass "--project c:/path/to/environment" as that argument and things should work as you want them to. (Note unix-style forward slashes in the path!) See command-line switches for Julia. I have not tested this today (and it's a while since I worked on JuliaExcel) so please let me know how you get on with this suggestion.

  2. To investigate I did the following
    a) opened a new workbook
    b) switched Excel calculation to Automatic
    c) entered formula =JuliaLaunch() in cell A1
    d) entered formula =JuliaEval("1:100") in A2 - to populate cells A2 to A101
    e) Saved, closed and reopened the workbook
    f) Observed that A2 to A101 were still populated.

I then put a breakpoint in the VBA code of JuliaEval and discovered that when re-opening the workbook JuliaEval is called. I think this means that Excel is treating cell A2 as containing a "volatile" formula. So I think MANUAL calculation is your best bet.

from juliaexcel.jl.

chris-hampel-CA avatar chris-hampel-CA commented on July 25, 2024

My PC is controlled by corporate IT. It is difficult for me to know if it is locked down by anti-virus but I could imagine it being likely.

  1. Your tip did work. Although I found the documentation tricky to follow because of [ in --project[={<dir>|@.}] listed in the documentation is not actually supposed to be used. I did as so julia --project="C:/Users/Christopher Hampel/Documents/AnalysisCA" . For anyone reading who also has an IT department who puts a pesky space in their home dir which proved to be an annoyance when doing this, you have to type the JuliaLaunch command like so. =JuliaLaunch(FALSE, TRUE, CONCAT("--project=",B1)) where B1 is a cell specified as a text type "C:/Users/Christopher Hampel/Documents/AnalysisCA" (and the first two args are optional)

  2. The MANUAL mode will work but it just takes diligence to know to turn excel to manual mode before opening a workbook that is known to contain JuliaExcel functions.

I have one final question. Do you know if plots can appear as figures in Excel from a JuliaEval command?

Thanks for all your prompt and thorough responses, Phillip!

from juliaexcel.jl.

PGS62 avatar PGS62 commented on July 25, 2024

No, JuliaEval certainly can't "return a plot" in the sense that a VBA function (which juliaeval is) cannot return an Excel chart when called from an Excel worksheet.

I think you have two options:

  1. Have your Julia function return data to the worksheet and use Excel's charting functionality to plot it.
  2. Have your Julia function generate a plot, save that plot to file (say in .svg) format and write code in the Worksheet_Calculate event of the worksheet's class module that inserts a picture into the sheet, based on that .svg file. I would only attempt this option if the plot\chart you want to generate is of a kind that's beyond Excel's capability. It's also a question of how much experience of VBA you have.

from juliaexcel.jl.

chris-hampel-CA avatar chris-hampel-CA commented on July 25, 2024

That makes sense. Thanks for all the help, again.

from juliaexcel.jl.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.