Giter Club home page Giter Club logo

Comments (6)

fzumstein avatar fzumstein commented on June 7, 2024 1

It runs Python via cmd.exe. You can try to see if "RunPython: Use UDF Server" checked makes a difference. Or you can migrate to xlwings Server that gets rid of local Python and any VBA, but is part of xlwings PRO.

from xlwings.

fzumstein avatar fzumstein commented on June 7, 2024 1

I don't know of any other way than doing this via cmd.exe: https://github.com/xlwings/xlwings/blob/main/xlwings/addin/Main.bas#L270-L275

from xlwings.

sau001-petroineos avatar sau001-petroineos commented on June 7, 2024

Hello @fzumstein ,
Thanks for the quick response, I tested with RunPython: Use UDF Server being checked. However ,it did not make any difference. The aforementioned Windows Defender alert popped up in both cases.

May I ask - What is the technical reason for choosing CMD.EXE to launch Python.exe as opposed to launching Python.exe directly?

Thanks,
Sau

from xlwings.

sau001-petroineos avatar sau001-petroineos commented on June 7, 2024

Hello @fzumstein ,

Your code makes sense.
image

I am pondering whether it makes sense to try and launch the Python process directly , i.e. without using cmd.exe /c .

I would like to do a small proof of concept to find the answer to the above question .

Thinking aloud - I could copy over your Main.bas in my personal Addin project. and make changes to the Wscript.Run arguments.

What do you think?

from xlwings.

fzumstein avatar fzumstein commented on June 7, 2024

Sure feel free! You're probably running into a problem with the LOG_FILE, which is used for error messages.

from xlwings.

sau001-petroineos avatar sau001-petroineos commented on June 7, 2024

Ok. This is what I have done.

  • Created a new XLAM and added the file xlwings.bas as myxlwings
  • Added a new VBA function HelloWorld in this XLAM
  • Wired a new ribbon button to the VBA function HelloWorld
  • The function HelloWorld invokes the RunPython from myxlwings.bas (renamed as NewRunPython)

image

Problem

tab = wb.sheets.active.name throws an error.

image

Question

Why can't Python find the Active Sheet ? See line 9 above

from xlwings.

Related Issues (20)

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.