I am writing a macro on button click. On this button click, I have three functions to run one after another.
Code is:
Sub submit()
ActiveWorkbook.Save
Call RUnCode
Call copy_paste_sheet
Call cumulative_percent
End Sub
Code for RUnCode is:
Private Sub RUnCode()
Dim pyPrgm As String, pyScript As String
pyPrgm = "python "
pyScript = "C:\Users\Kishan\Desktop\script.py"
Call Shell(pyPrgm & pyScript, vbMinimizedNoFocus)
End Sub
Function RUnCode is running a python script through command line. It is takes some time to run, and I need data from python script for copy_paste_sheet and cumulative_percent function (Both functions are simple excel sheet manipulations).
But problem is: before the RUnCode is over, other two functions are running, thereby leading to processing the wrong data.
Can you help me with this. Thanks in advance.