current position:Home>pywintypes. com_ Error: (- 2147023728, 'element not found', none, none)
pywintypes. com_ Error: (- 2147023728, 'element not found', none, none)
2022-02-03 00:38:50 【CSDN Q & A】
The phenomenon and background of the problem
Computer update ,EXCEL Something unusual happened , reinstall OFFICE2016 in the future , use python open EXCEL Report errors . meanwhile CAD Can't open EXCEL 了 . It has been used normally before .
Problem related code , Do not paste screenshots
import xlwings as xwimport os# Implicitly open EXCEL surface app = xw.App(visible=False, add_book=True)# Original worksheet old_wb = xw.Book(r'G:\ Calculation of quantities \1604.xls')old_sht = old_wb.sheets[' Table 3A ']# print(old_sht.name)first_col = 12 # From page... In the original worksheet 12 Column starts writing data counts = 0 # Worksheet count # Traverse all the... Under a folder EXCEL file for file in os.listdir(r'G:\ Calculation of quantities \1604 Data sheet '): f = 'G:/ Calculation of quantities /1604 Data sheet /' + file wb = xw.Book(f) shts = wb.sheets
Operation results and error reporting contents
Traceback (most recent call last): File "G:/ Calculation of quantities / Calculate the quantities / Write the quantities into the original batch EXCEL in .py", line 6, in <module> app = xw.App(visible=False, add_book=True) File "C:\Users\zhong\AppData\Local\Programs\Python\Python37\lib\site-packages\xlwings\main.py", line 209, in __init__ self.impl = xlplatform.App(spec=spec, add_book=add_book, visible=visible) File "C:\Users\zhong\AppData\Local\Programs\Python\Python37\lib\site-packages\xlwings\_xlwindows.py", line 313, in __init__ self._xl = COMRetryObjectWrapper(DispatchEx('Excel.Application')) File "C:\Users\zhong\AppData\Local\Programs\Python\Python37\lib\site-packages\win32com\client\__init__.py", line 113, in DispatchEx dispatch = pythoncom.CoCreateInstanceEx(clsid, None, clsctx, serverInfo, (pythoncom.IID_IDispatch,))[0]pywintypes.com_error: (-2147023728, ' Element not found .', None, None)
My solution ideas and tried methods
Tried to change EXCEL Registry method , Change permissions , Neither. .
What I want to achieve
Refer to the answer 1:
Check the registry OFFICE2016 Whether you have successfully registered in it , This is caused by a registry error , Use the cleaner below to clear the registry and reinstall it again
https://download.csdn.net/download/qq657441718/10312805
Refer to the answer 2:
copyright notice
author[CSDN Q & A],Please bring the original link to reprint, thank you.
https://en.primo.wiki/2022/02/202202030038483365.html
The sidebar is recommended
- How can I fix the problem of uploading to idea
- com. fasterxml. jackson. databind. Objectmapper throw exception
- What is the reason and how to solve it
- Preparestatement of javajdbc
- int x=8,y=12,z=14 ; x++,y=z++,z=++x; y=x%z- -; Find the value of XYZ
- Why is this the case when I access the PHP test program under localhost in MacOS?
- Why should this code be int & n instead of int n? In C + +, under what circumstances do you need to be int & n
- The redis session problem runs well locally. As soon as it arrives online, it crazy reports exceptions. It starts to report when it starts. And the function can be used normally
- Research on Professional Course Scheduling Based on nonlinear programming
- The question about C + +: that's it: include 'Einstein h'
guess what you like
-
Sqlyog failed to import the database. I don't know what to do
-
The Microsoft edge browser can only enter the address in the address bar and cannot search
-
Why can't data be saved when text is written in this way?
-
When the user logs in and out, a socket error is reported when he logs in again
-
The website editor cannot be right-click pasted and cannot be used
-
On the problem of multi-threaded ball taking and putting (language Java)
-
Start the flume script and report an error in the generated log file: agent configuration for 'A1' has no configfilters
-
What can reflect the professional quality of a yard farmer?
-
Why is the returned hour, minute and second Nan
-
Python, C problem - leap year judgment
Random recommended
- SQL. Why not attach it, as shown in the figure
- How does robotjs set automatic rebuild in electronic build
- Python final exam SOS
- I admit that I have degenerated, but I still want to know how to solve Java
- I have encountered several array problems in C + +. I hope the big God can solve the puzzle. It's best to have comments
- Why is it double? don't get it
- C language novice village, high adoption rate
- The usage and law of this function are expected to be explained.
- Let's see what's wrong. My code will output one less country
- Why is the average 0
- The replacement of tab key in hive leads to a problem in the file.
- Now to realize a function, use the El tree component of element UI, select the relevant node, and then copy a new tree with only relevant parent-child nodes below.
- Sqlyog database import failed with the following error. Do you know
- How do two lists compare in the same location
- How to group the following data by film and television, education, music, E-sports and other sectors
- Server socket + Android socket can only send a message once after connecting. The second sending does not respond. You need to reconnect the socket and solve it
- Questions about student information management system C++
- Qtable widget of QT double click to edit and display the problem
- Separate strings and insert a comma for each 5 characters
- QT qtablewidget double click to modify the content. What is the problem
- MySQL reports an error in Navicat. How to solve it?
- Router link cannot jump into router view (Vue)
- Why is the camera preview frame obtained by Android like this
- How to implement JS? The address bar changes the page load and refresh, and the selected conditions of the current page remain unchanged as all by default
- Why did 0.3 become 0.2999999999
- What is the reason for the warning when Vue project is packaged
- Yolov5 deployment final inference report cannot find picture
- How to extract the characters of a paragraph in Notepad?
- Computer network technology IP questions
- MySQL group query gets the data of the first 24 hours in each group
- What's wrong with this and need to be changed?
- Write a program to find the number of integers between 200 and 300 that meet the following conditions. Condition: the product of hundreds, tens and individuals is equal to the sum of hundreds, tens and individuals
- In Python, the condition setting and interpretation of while loop
- How can jupyter notebook run on the next line of code followed by the above code
- The page has been loaded. Press F12 at the top to show it. What's going on
- This CompareTo method is not called. How do you sort the elements in the collection
- Using pointer method: input three integers ABC and output them in order of size
- C # new ADO Net data model, error, failed to load file or assembly
- Input n integers from the keyboard and store them in a pile of arrays. Put all positive numbers in the array in front of the array and negative numbers in the back to output the array
- Why can't the small gourd be installed.