c++ - 使用 OLE 以编程方式保存 Excel 文件

标签 c++ excel c++builder ole

如何使用 OLE 和 C++ Builder 以编程方式保存 Excel 工作簿?

我猜它可能是这样的:

Variant excel = Variant::CreateObject("Excel.Application");
excel.OleProcedure("Save"); // but how might you specify the file name

最佳答案

哦,刚刚从 here 找到了答案:

excel.OlePropertyGet(”Workbooks”).OlePropertyGet(”Item”,1).OleProcedure(”SaveAs”,”d:\\case1.xls”);

首先您获得工作簿对象,然后是工作簿。然后你可以做一个另存为。

关于c++ - 使用 OLE 以编程方式保存 Excel 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3106188/

相关文章:

excel - 公式在一列中搜索数据,然后应用公式

Excel 日期转 Unix 时间戳

c++builder - 在 C++ 中注册 Style Hook

c++ - Base64 加密/解密 (C++ Builder XE)

c++ - 我需要在 C++ 中对齐吗?

c++ - DirectShow:YV12 渲染

C++ 列表排序函数

java - 如何使用 apache poi 增加 excel 中的行数

c++ - 如何使用 C++ 正确检查注册表项是否存在?

delphi - TQuery 上的 AfterScroll 和 AfterOpen