I am tyring to do some data analysis on an .xlsm file through a python script that is opened by VBA although I have checked through the Powershell that my system has the permission requied to open it.
Excerpt of Python file of interest:
import pandas as pd
import csv
df = pd.read_excel('2020 csv prices_less_till_thu called from vba1.xlsm')
df.to_csv('2020 csv prices_less_till_thu called from vba1.csv')
filename = '2020 csv prices_less_till_thu called from vba1.csv'
with open(filename) as csv_file:
Knowing that this could be a permissions error (have tried the solution to this), I checked, using the Powershell that the file was not restricted in its access:
I nonetheless, while running the VBA module:
Set objShell = VBA.CreateObject("Wscript.Shell")
PythonExePath = """C:\Users\[REDACTED]\python.exe """
PythonScriptPath = """C:\Users\[REDACTED]\Price analysis\Check 2020 from VBA.py"""
objShell.Run PythonExePath & PythonScriptPath
get an Errno13 error:
I've tried the above fix, adding spaces to paths, but can't seem to fix it?
Any idea? Thanks!
PS: Do you know of any library that would be an all in one solution?