I have the following error in my code, I have tried everything and I can not solve:
1° Not Successful
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° Not Successful
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')
The two attempts return the following problem to me:
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)
As you can see already tried to leave in absolute path, already tried to leave the full path, I already put excel.Application.Quit() before that stretch as well and nothing.
I need the code to go through this step to start formatting the whole file.