bool Path::Pars_xlsx_L(QString name, QString& path)
{
Document xlsxLink("D:/QT_proj/OProg/Open_Prog/Path.xlsx");
bool result{false};
for (int row = 2; row < 20; ++row) {
cell = xlsxLink.cellAt(row, 1);
QVariant var = cell->readValue();
if (name == var) {
cell = xlsxLink.cellAt(row, 2);
path = cell->readValue().toString();
result = true;
}
else
return result;
}
}
bool Path::Pars_xlsx_L(QString name, QString& path)
{
Document xlsxLink("Path.xlsx");
bool result{false};
for (int row=2; row<20; row++)
{
for (int col=1; col<2; col++)
{
cell = xlsxLink.cellAt(row,col);
QVariant var = cell->readValue();
if (var == name)
{
path = xlsxLink.read("B2");
result = true;
}
else
return result;
}
}
}
for i in list_directory:
print('Начинаем обработку файла:', i)
wb = openpyxl.load_workbook(i)
ws = wb.active
print (wb.sheetnames)
for sheet in wb:
sheet.oddHeader.left.text = ""
sheet.oddHeader.center.text = ""
sheet.oddHeader.right.text = ""
sheet.oddFooter.left.text = ""
sheet.oddFooter.center.text = ""
sheet.oddFooter.right.text = ""
print('save all changes')
wb.save(i)
wb.close()
print (wb.sheetnames)
может быть в этой записи проблема