vba

Why isn't Jupyter notebook running from VBA?

Why isn't Jupyter notebook running from VBA? Question: I’m trying to run a Jupyter notebook from Access VBA: Sub import_hawk() Dim objShell As Object Dim PythonExe, PythonScript As String Set objShell = VBA.CreateObject("Wscript.Shell") PythonExe = """C:UsersPhilip.condaenvslatestpython.exe""" PythonScript = "C:UsersPhilipOneDriveBettingCapraTennispolgarapolgara.ipynb" objShell.run PythonExe & PythonScript End Sub When I run it then a box does briefly appear …

Total answers: 1

How do I send/read data from VBA in Python?

How do I send/read data from VBA in Python? Question: Background Right now I’m creating a macro to help automate the creation of some graphs in VBA. However, the creation of the graphs requires specific tasks to be done, for example, certain points in a series to be larger depending on previous instances. I would …

Total answers: 2

xlwings RunPython with function arguments

xlwings RunPython with function arguments Question: I am trying to run the RunPython function from a button in excel. I would like the function to take a parameter from a box in excel, something like this: Sub ImportData() Dim choice As String choice = Range(“B2”).Value RunPython (“import Excel_module; Excel_module.importing_data(choice)”) End Sub Is this a possibility? …

Total answers: 2

Can't install XLWings add-in into excel no matter what I do

Can't install XLWings add-in into excel no matter what I do Question: I really, really wanted to try this add-in for excel, but no matter what myself or my colleagues (to include one of my information systems professors) tried, we couldn’t get it to work. Excel, in order to use an add in, must have …

Total answers: 3

Python pandas write resulted dataframe to xlsm without losing the macro

Python pandas write resulted dataframe to xlsm without losing the macro Question: I have a lot of excel files that I need to compile into a single excel file, and then copy the compiled one into an existing excel file (with macro / .xlsm) in a certain sheet. I solved the first problem (compiling multiple …

Total answers: 4

Running an Excel macro via Python?

Running an Excel macro via Python? Question: I’m trying to run a macro via python but I’m not sure how to get it working… I’ve got the following code so far, but it’s not working. import win32com.client xl=win32com.client.Dispatch(“Excel.Application”) xl.Workbooks.Open(Filename=”C:test.xlsm”,ReadOnly=1) xl.Application.Run(“macrohere”) xl.Workbooks(1).Close(SaveChanges=0) xl.Application.Quit() xl=0 I get the following traceback: Traceback (most recent call last): File “C:test.py”, …

Total answers: 9

How to call python script on excel vba?

How to call python script on excel vba? Question: Trying to call a python script on Vba and I am a newb. I tried converting the main script to an exe using py2exe and then calling it from VBA (shell) but the main script calls other scripts therefore it becomes complicated and I messed it …

Total answers: 13

Using Python to program MS Office macros?

Using Python to program MS Office macros? Question: I’ve recently taken it as a project to teach myself how to program in Python. Overall, I must say that I’m impressed with it. In the past I’ve typically stuck to programming in VBA mostly for MS Excel (but also a bit in MS Access and Word) …

Total answers: 6