refer to the following. it display number in string format.
///
//change cell font of Excel
///
void CC2Dlg::OnOK()
{//HOWTO: Create Automation Project Using MFC and a Type Library Q178749
//change font of a Cell in excel
try
{
_Application app; // app is an _Application object.
_Workbook book; // More object declarations.
_Worksheet sheet;
Workbooks books;
Worksheets sheets;
Range range; // Used for Microsoft Excel 97 components.
LPDISPATCH lpDisp; // Often reused variable.
COleVariant
covTrue((short)TRUE),
covFalse((short)FALSE),
covOptional((long)DISP_E_PARAMNOTFOUND, VT_ERROR);
if(!app.CreateDispatch("Excel.Applicatio
在vc++中调用Excel,怎样设置单元格的格式可以得到科学计数法显示,且保留两位小数
该博客详细介绍了如何在VC++中使用Automation调用Excel,并设置单元格的格式以显示为科学计数法,同时确保数值保留两位小数。通过创建和操作Excel应用、工作簿、工作表和范围对象,以及调整字体,展示了具体的代码实现过程。
摘要由CSDN通过智能技术生成