У меня есть следующая ошибка в моем коде, я попробовал все, и я не могу решить:
1 ° Не удалось
excel = win32com.client.Dispatch("Excel.Application")
wb = excel.Workbooks.Open(os.path.join(os.getcwd(),diretorio_BKP + filename +
' '+str(nome_arq_parcial)+' -.xlsx'))
ws = wb.Worksheets(1).Select()
ws = wb.Worksheets(1)
print('abrir o arquivo de novo')
2 ° Не удалось
excel = win32com.client.Dispatch("Excel.Application")
wb = excel.Workbooks.Open(diretorio_BKP + filename +' '+
str(nome_arq_parcial)+' -.xlsx')
ws = wb.Worksheets(1).Select()
ws = wb.Worksheets(1)
print('abrir o arquivo de novo')
Две попытки возвращают мне следующую проблему:
ERRO: (-2147352567, 'Exception.', (0, 'Microsoft Excel', "Microsoft Excel does not you can access the file '\\\\ IEMEN \\ file location -.xlsx'. There are several reasons possible: \ r \ n \ r \ n • The file name or path does not exist. \ r \ n • The file is being used by another program. \ r \ n • The workbook you are trying to save has the same name as another currently open \ r \ nfolder. ", 'xlmain11.chm', 0, -2146827284), None)
Как вы можете видеть, уже пытались выйти по абсолютному пути, уже пытались оставить полный путь, я уже поставил excel.Application.Выйдите () и до этого, и ничего.
Мне нужен код, чтобы пройти этот шаг, чтобы начать форматирование всего файла.