【问题标题】:ExportAsFixedFormatExportAsFixedFormat
【发布时间】:2010-11-27 18:51:53
【问题描述】:

为什么下面的代码返回无效参数错误?它在 Delphi 中的等价物执行良好。

C++ 生成器:

ActiveWorkSheet.OleProcedure("ExportAsFixedFormat", 0, EmptyParam,
        EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam,
        EmptyParam);

德尔福:

  oSheet.ExportAsFixedFormat(0, // xlTypePDF is constant 0
    EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam,
    EmptyParam, // set to True to open Acrobat
    EmptyParam);

【问题讨论】:

    标签: delphi excel excel-2007 c++builder ole


    【解决方案1】:

    在 C++ 中(至少在 VC 中),参数顺序必须颠倒。试试这个:

    ActiveWorkSheet.OleProcedure("ExportAsFixedFormat", EmptyParam, 空参数,空参数,空参数,空参数,空参数,空参数, 空参数,0);

    希望这会有所帮助

    【讨论】:

      【解决方案2】:

      添加另一个 EmptyParam。该函数有 9 个参数,因此当您使用 OleProcedure 调用它时,您必须发送 10 个参数(因为第一个参数是函数名)。你只发送了 9 个。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2013-07-27
        • 1970-01-01
        • 2014-03-04
        • 2015-05-22
        • 2016-06-21
        • 1970-01-01
        相关资源
        最近更新 更多