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"]