1

I am trying to trigger the .ipynb file using VBA. I have written the following code; however, the command doesn't execute the file and escape from the loop without any error. Could you please let me know where I am going wrong in the below piece of VBA code?

Sub RunScript()

    Dim Ret_Val
    FilePath = """ C:\Users\ABC\def.ipynb"""
    Python = """ C:\Program 
    Files\Anaconda3\python.exe"""
    Ret_Val = Shell(Python & " " & 
    FilePath, vbNormalFocus)
    If Ret_Val = 0 Then
        MsgBox "Error", vbOKOnly
    End If

End Sub

I have tried the .py file, and it worked well. However, I am facing an issue with .ipynb files.

Add
  • 407
  • 1
  • 4
  • 9
  • https://stackoverflow.com/questions/35545402/how-to-run-an-ipynb-jupyter-notebook-from-terminal – CDP1802 Jan 31 '22 at 14:45
  • @CDP1802 I was able to run the code above correctly, but still, there is one issue here. In my python script, I am handling errors separately. However, while running the macro, it gets stuck at error and doesn't proceed further. Do you know how to ignore errors and run the entire script, bypassing the them in vba ? – Add Feb 01 '22 at 07:48

0 Answers0