用什么函数可以设置单元格的格式为文本啊,请各位帮忙?

cumtbrainman cumtbrainman 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
本人写的一个报表程序,大体是这样的:
先在报表导入模块,导入报表模板,然后填充数据库的数据
但是填充是出了问题:
填煤层名称时,煤层名称是2-3,但是显示出来是日期格式 20005-2-3
我在excel中该单元格格式为文本,但是在程序中不认,各位大侠能不能告诉我用什么函数可以让单元格的格式为文本?
我的代码如下:
oleobject Cellformat
cellformat = w_printexcel.ole_1.object.CreateNewCellFormat

w_printexcel.ole_1.object.setrowheight(ll_currow,ll_currow,420,false)//设置行高
w_printexcel.ole_1.object.setactivecell(7,3)
cellformat = w_printexcel.ole_1.object.GetCellFormat
w_printexcel.ole_1.object.setactivecell(ll_currow,3)
w_printexcel.ole_1.object.SetCellFormat(cellformat)
if not isnull(ls_mcmc[n]) then
w_printexcel.ole_1.object.Entry = ls_mcmc[n]//煤层名称
end if

还有就是怎么能够合并单元格? 我用:
w_printexcel.ole_1.object.setselection((ll_currow - m - 1),2,ll_currow ,2)
并没有成功,不知道为什么
...全文

相关推荐

评论 5
收藏 已收藏
分享
返回顶部
cumtbrainman
DataWindow 611 成员 20,469 内容