Qt中添加activex控件操纵excel

        首先要向工程文件中添加:“CONFIG+= qaxcontainer”。

    QFile outfile("excel.html");
    QTextStream out(&outfile);
    QAxObject *excel = new QAxObject("Excel.Application", this);

    outfile.open(QIODevice::WriteOnly);
    QString docu = excel->generateDocumentation();
    out << docu;
    outfile.close();
        以上代码可以用来查看可用的对象接口,其他的慢慢研究啦。

你可能感兴趣的:(Excel,qt)