schatterjee9
New Member
- Joined
- Nov 20, 2014
- Messages
- 1
I am currently developing a tool for a client that interfaces with both python 2.7 and excel 2013 and as a result running into a problem.
As background, I have a python code I want to run as a executable. The client doesn't have python on their computers so it's vital that the exe runs without .py. I've converted the script from a .py to a .exe with py2exe. Then I am trying to call that .exe with VBA. When the macro runs it looks like it pulls up the command prompt for a second but it doesn't run the .exe. When I go into the directory and double click the .exe however, it runs fine and outputs what I want it to.
Below is my code in VBA:
Not sure if my Shell needs any other inputs
Any help would be appreciated!
As background, I have a python code I want to run as a executable. The client doesn't have python on their computers so it's vital that the exe runs without .py. I've converted the script from a .py to a .exe with py2exe. Then I am trying to call that .exe with VBA. When the macro runs it looks like it pulls up the command prompt for a second but it doesn't run the .exe. When I go into the directory and double click the .exe however, it runs fine and outputs what I want it to.
Below is my code in VBA:
Code:
Dim folderPath As String
folderPath = Application.ActiveWorkbook.Path
ChDir folderPath
Dim stAppName As String
stAppName = folderPath & "\dist\MAT.exe"
Call Shell(stAppName, 1)
Not sure if my Shell needs any other inputs
Any help would be appreciated!
Last edited: