Error: Userwarning: Data Validation Extension is not supported and will be Removed

Asked

Viewed 767 times

0

Beginner in the world of programming, I’m trying to make a script that I pull information from API of the recipe and play in a excel, but I can’t write on excel due to error, when I put read_only=true error stops appearing, someone can help?

The mistake:

Userwarning: Data Validation Extension is not supported and will be Removed.

Piece of the Code.

import requests
import openpyxl
import time
import json



wb = openpyxl.load_workbook(r'X:\NUCLEO_FINANCEIRO\Serviços Financeiros\1. Rede Atual\4. Gestão de Documentos\2. Formulários Bancários\1. Cadastro Único\Robo Cadastro Único\Cadastro Único.xlsm',keep_vba=True, data_only=True)

Sheet = wb["CNPJ"]

RowCount = str(Sheet.max_row)

#Loop que utiliza a API da receita a cada 23 segundos.

for RowOfCellObjects in Sheet['A1:A' + RowCount]:
    for cellobj in RowOfCellObjects:
        CNPJ = cellobj.value
        print(CNPJ)
        Site = "https://www.receitaws.com.br/v1/cnpj/" + CNPJ
        Response = requests.request("GET",Site)
        CNPJData = json.loads(Response.text)
        WriteInto = wb['Python']


        WriteInto['A2'] = CNPJData["nome"]

1 answer

0

The error you are experiencing is caused by the library openpyxl. It is not complete and does not understand all the elements of a Microsoft spreadsheet. More specifically, it has not implemented in 100% the interpretation of Child element Data Validation, and of these others: Conditional Formatting, Sparkline Group, Slicer List, Protected Range, Ignored Error, Web Extension, Slicer List, Timeline Ref.

To work, you need to simplify the spreadsheet or retire once and for all the use of Excel, make the data come from database or text file, and, after getting them, generate from scratch the spreadsheet.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.