lua *** 作excel

lua *** 作excel,第1张

概述lua *** 作excel

下面是内存溢出 jb51.cc 通过网络收集整理的代码片段。

内存溢出小编现在分享给大家,也给大家做个参考。

require 'luacom'local excel = luacom.CreateObject('Excel.Application')excel.Visible = truelocal book = excel.Workbooks:Add()local sheet = book.Worksheets(1)sheet.name = 'gty'local range = sheet:Range('A1:A10')local cell = sheet.Cells(1,1)sheet:Range('D3:D6'):Merge()--合并单元格range.Value2 = 1range.Font.Size = 20sheet.Cells(1,2).FormulaR1C1 = '=R3C1+R4C1'	--公式cell.Value2 = 'gty'cell.Font.name = 'Arial'--cell.Font.FontStyle = 'bold'cell.Font.Bold = truesheet.Cells(4,5).EntireRow.Interior.color = 0x334455	--整行 *** 作sheet.Cells(4,5).EntireColumn.Interior.color = 0x998877	--整列 *** 作cell.Font.Size = 20cell.Font.color = 0x0000ffcell.Font.Underline = truecell.Font.Strikethrough = true	--删除线cell.Font.OutlineFont = true	--下划线range.Interior.color = 0x778899	--区域上色range.borders.linestyle = 1		--边框样式 --每个小的内边框sheet:Range('C2:G7').borderAround(1)--外边框--range.borders.Weight = 4		--边框宽度--range.Interior.Pattern = 8	--区域花纹--cell.Font.Shadow = true--cell.Font.SuperScript = true--cell.Font.SubScript = trueprint(range.Cells.Count)	--统计单元格数print(range.Rows.Count)print(range.Columns.Count)range.NumberFormat = '$#,##0.00'	--格式化数字sheet:Range('A2'):Cut()		--剪切sheet:Range('A3'):copy()	--复制sheet:Paste(sheet:Range('B3')) --粘贴book.Worksheets('sheet3'):Delete()book:SaveAs(filePath,51)--51xlsx -4143xlsexcel:Quit()

以上是内存溢出(jb51.cc)为你收集整理的全部代码内容,希望文章能够帮你解决所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

总结

以上是内存溢出为你收集整理的lua *** 作excel全部内容,希望文章能够帮你解决lua *** 作excel所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/langs/1278310.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-09
下一篇 2022-06-09

发表评论

登录后才能评论

评论列表(0条)

保存