Thanks, got it to work in the virtual environment as far as the line
import openpyxl as xl
is concerned. However, when I add
wb = xl.load_workbook('transanctions.xlsx')
I get the error
"D:\Power BI & Python\venv\Scripts\python.exe" "D:/Power BI & Python/Test.py"
Traceback (most recent call last):
File "D:\Power BI & Python\Test.py", line 3, in <module>
wb = openpyxl.load_workbook('transanctions.xlsx')
File "D:\Power BI & Python\venv\lib\site-packages\openpyxl\reader\excel.py", line 315, in load_workbook
reader = ExcelReader(filename, read_only, keep_vba,
File "D:\Power BI & Python\venv\lib\site-packages\openpyxl\reader\excel.py", line 124, in __init__
self.archive = _validate_archive(fn)
File "D:\Power BI & Python\venv\lib\site-packages\openpyxl\reader\excel.py", line 96, in _validate_archive
archive = ZipFile(filename, 'r')
File "C:\Users\Aziz\AppData\Local\Programs\Python\Python310\lib\zipfile.py", line 1249, in __init__
self.fp = io.open(file, filemode)
FileNotFoundError: [Errno 2] No such file or directory: 'transanctions.xlsx'
Process finished with exit code 1
If I use
wb = xl.load_workbook('D:\Power BI & Python\transanctions.xlsx')
I get the error
"D:\Power BI & Python\venv\Scripts\python.exe" "D:/Power BI & Python/Test.py"
Traceback (most recent call last):
File "D:\Power BI & Python\Test.py", line 3, in <module>
wb = xl.load_workbook('D:\Power BI & Python\transanctions.xlsx')
File "D:\Power BI & Python\venv\lib\site-packages\openpyxl\reader\excel.py", line 315, in load_workbook
reader = ExcelReader(filename, read_only, keep_vba,
File "D:\Power BI & Python\venv\lib\site-packages\openpyxl\reader\excel.py", line 124, in __init__
self.archive = _validate_archive(fn)
File "D:\Power BI & Python\venv\lib\site-packages\openpyxl\reader\excel.py", line 96, in _validate_archive
archive = ZipFile(filename, 'r')
File "C:\Users\Aziz\AppData\Local\Programs\Python\Python310\lib\zipfile.py", line 1249, in __init__
self.fp = io.open(file, filemode)
OSError: [Errno 22] Invalid argument: 'D:\\Power BI & Python\transanctions.xlsx'
Process finished with exit code 1