Excel如何将单元格设为文本
发布时间:2024年01月05日
在caa开发过程中遇到从CATUnicodeString转成CString时,通过SetItemText写入将ID号写入单元格,无法保存ID号中的数字0,故将单元格格式改为文本来存储。效果如下:
单元格格式为默认的“常规”时,ID号中所有的前缀 “0 ”丢失:

单元格格式为“文本”时,正常:

一、打开excel文件

二、选中单元格

三、右键设置单元格格式

四、设置界面选择文本后点确定

五、其他问题
关闭开发的程序后,打开xlxs文件查看内容,若显示被锁定

说明开发的程序不直接打开编辑.xlxs的软件,而是在后台启用了其进程进行写入编辑操作,关闭开发的程序后,该进程还在,可手动结束进程或者使用C++做杀进程来解除占用。

文章来源:https://blog.csdn.net/m0_48170265/article/details/135403052
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如若内容造成侵权/违法违规/事实不符,请联系我的编程经验分享网邮箱:chenni525@qq.com进行投诉反馈,一经查实,立即删除!