|
Python Connector for Microsoft Excel Online Using the module - Python Connector for Microsoft Excel Online |
|
To retrieve data from Microsoft Excel Online:
import devart.excelonline as excelonline
connect() module method and obtain a connection object.
response = excelonline.signin()
my_workbook = excelonline.getworkbook()
my_connection = excelonline.connect(
WorkbookId=my_workbook["Workbook Id"]
RefreshToken=response["Refresh Token"]
)
cursor object using the cursor() connection method.
my_cursor = my_connection.cursor()
execute() cursor method.
my_cursor.execute("SELECT * FROM all_types")
fetch*() cursor methods.
for row in my_cursor.fetchall():
print(row)