# import openpyxl module
import openpyxl
# Call a Workbook() function of openpyxl
# to create a new blank Workbook object
wb = openpyxl.Workbook()
# Get workbook active sheet
# from the active attribute.
sheet = wb.active
# writing to the specified cell
sheet.cell(row = 1, column = 1).value = ' hello '
sheet.cell(row = 2, column = 2).value = ' everyone '
# set the height of the row
sheet.row_dimensions[1].height = 70
# set the width of the column
sheet.column_dimensions['B'].width = 20
# save the file
wb.save('dimension.xlsx')
正如在Missing Features下所解释的,您始终可以下拉到pywin32并检查documentation for VBA
在您的情况下,它的工作原理如下:
到目前为止,您还没有办法在xlwings中实现它,但是如果您可以使用openpyxl实现它的话 here is the link for better understanding
相关问题 更多 >
编程相关推荐