albie0803
Alibre Super User
last line throws error
Traceback (most recent call last):
File "<string>", line 13, in <module>
File "C:\PROGRAM FILES\ALIBRE DESIGN\PROGRAM\ADDONS\ALIBRESCRIPT\PythonLib\site-packages\openpyxl\reader\excel.py", line 118, in load_workbook
File "C:\PROGRAM FILES\ALIBRE DESIGN\PROGRAM\ADDONS\ALIBRESCRIPT\PythonLib\site-packages\openpyxl\reader\excel.py", line 66, in repair_central_directory
UnicodeDecodeError: ('unknown', u'\xd0', -1, 0, '')
File has macros and protected cells.
The same line works fine on a basic excel file in a different script
Looking at it is it because its an xlsm file and not an xlsx one?
Code:
import os
Win = Windows()
MyAss = CurrentAssembly()
# get XLSC reading functions
from openpyxl import load_workbook
# Get math extensions
import math
# open a workbook, replace with your own path
wb = load_workbook(filename = 'C:\\Users\\allan\\Desktop\\Gleason Bevels\\Straight_Bevel_TS_TCA_10_07_16-Buttons Chordals-1.xlsm', data_only=True)
Traceback (most recent call last):
File "<string>", line 13, in <module>
File "C:\PROGRAM FILES\ALIBRE DESIGN\PROGRAM\ADDONS\ALIBRESCRIPT\PythonLib\site-packages\openpyxl\reader\excel.py", line 118, in load_workbook
File "C:\PROGRAM FILES\ALIBRE DESIGN\PROGRAM\ADDONS\ALIBRESCRIPT\PythonLib\site-packages\openpyxl\reader\excel.py", line 66, in repair_central_directory
UnicodeDecodeError: ('unknown', u'\xd0', -1, 0, '')
File has macros and protected cells.
The same line works fine on a basic excel file in a different script
Code:
# Open XLSX File for usage
wb = load_workbook(filename = 'C:\\Users\\Allan\\Desktop\\shaft sizes.xlsx', data_only=True)
Looking at it is it because its an xlsm file and not an xlsx one?