#include
#include “ExcelOperation.h”
using namespace std;
int main()
{
if (S_OK != CoInitialize(NULL))//init
{
cout<<“初始化ole失败”<<endl;
return -1;
}
ExcelOperation excel;
if (excel.OpenFromTemplate(_T(“C:\Users\728297725\Desktop\111.xls”)))
{
excel.SaveAsPDF(_T(“E:\test.pdf”));
}
excel.Close();
CoUninitialize();//Uninitialize
return 0;
}