用什么函数可以设置单元格的格式为文本啊,请各位帮忙?
本人写的一个报表程序,大体是这样的:
先在报表导入模块,导入报表模板,然后填充数据库的数据
但是填充是出了问题:
填煤层名称时,煤层名称是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)
并没有成功,不知道为什么