以编程方式使用OLE保存Excel文件
问题描述:
如何使用OLE和C ++ Builder以编程方式保存excel工作簿?
How do you programmatically save an excel workbook using OLE and C++ Builder?
我猜这可能是这样的:
Variant excel = Variant::CreateObject("Excel.Application");
excel.OleProcedure("Save"); // but how might you specify the file name
答
哦刚刚找到这里的答案:
excel.OlePropertyGet("Workbooks").OlePropertyGet("Item",1).OleProcedure("SaveAs","d:\\case1.xls");
首先,您获得工作簿后面的工作簿对象。然后你可以做一个SaveAs。
First you get the workbooks object followed by the workbook. Then you can do a SaveAs.