Home > other >  Run python xlwings API does not perform is not an error?
Run python xlwings API does not perform is not an error?

Time:05-09

The python version 3.7, xlwings version for 0.23.1, pywin32 version 300, run to sht_1. API. UsedRange. Rows. The count, not perform error, when debugging, program also does not end, display has been run,

Ps:

My two computers, at home to write good code, computer can run in the home, to go to the company computer can't run, company and home pycharm, python, xlwings, pywin32 version are the same,
In addition to the computer company, to open the program calls for EXCEL, 2013 version of the installation (not install EXCEL, complains), home computer installed WPS, not install EXCEL,
The code is as follows:

The import xlwings as xw

Def jisuan_1 () :
App=xw. App (visible=False, add_book=True)
Wb_1=app. Books. The open (' C:/Users/Administrator/Desktop/4 make. XLS ') # replaced with path_1. After the completion of the get ()
Sht_1=wb_1. Sheets [0]
Print (sht_1)

Rows=sht_1. API. UsedRange. Rows. # count total number of rows

Cols=sht_1. API. UsedRange. Columns. # count the total number of columns
Print (rows)

  • Related