M
M
MegaTort2021-08-15 23:41:53
Python
MegaTort, 2021-08-15 23:41:53

How to run python exe via vba excel?

I constantly get an error when running exe Python

What's the point.
There is some excel document in which I fill in the data. There is a button in this excel that launches an exe file written in python. The file itself launches a txt file in which the code is written, I read it through exec (). Further, the read code already refers to this excel file and takes the necessary data.

If I manually run the exe file, then everything works fine, but if I access it through Excel (Shell.Run), then an error occurs.
Excel and exe file are in the same folder.

If you make an exe file with a working code and access it through Excel, then everything works.
For some reason, an error occurs when you access exactly the exe, which is a reader, so to speak, in which exec is written, but when you start it manually, everything works

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexa2007, 2021-08-16
@Alexa2007

Excel is in program files, and what is in the same folder with the exe file is called "document"
specify the full path to the exe file

B
BasiC2k, 2021-08-16
@BasiC2k

To understand what kind of error occurs
Check for simultaneous access to the Excel file. If it is already open, then it can be reopened only in readonly mode (this is specified by the parameter when opening).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question