Skip to content

Instantly share code, notes, and snippets.

@blog-aspose-cloud
Last active May 23, 2022 19:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save blog-aspose-cloud/53dc8973c876a9c745d65570de240af5 to your computer and use it in GitHub Desktop.
Save blog-aspose-cloud/53dc8973c876a9c745d65570de240af5 to your computer and use it in GitHub Desktop.
Convert Excel to CSV in Python
# For more code samples, please visit https://github.com/aspose-cells-cloud/aspose-cells-cloud-python
def XLSMtoCSV():
try:
#Client credentials
client_secret = "1c9379bb7d701c26cc87e741a29987bb"
client_id = "bbf94a2c-6d7e-4020-b4d2-b9809741374e"
# initialize CellsApi instance
cellsApi = asposecellscloud.CellsApi(client_id,client_secret)
# input XLSB workbook
input_file = "myDocument.xlsm"
# resultant format
format = "CSV"
# resultant file name
output = "Converted.csv"
# call the API to convert XLSM to CSV
response = cellsApi.cells_workbook_get_workbook(name = input_file, format=format, out_path=output)
# print response code in console
print(response)
# print message in console (optional)
print('XLSM sucessfully converted to CSV !')
except ApiException as e:
print("Exception while calling CellsApi: {0}".format(e))
print("Code:" + str(e.code))
print("Message:" + e.message)
Learn how to convert Excel to CSV in Python using Aspose.Cells Cloud SDK for Python
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment