无法使用 dxl 保存导出的 excel

Not able to save exported excel with dxl

Module m = current

string s = name(m)

OleAutoObj wDocs = null

OleAutoArgs args = create()

OleAutoObj wApp = oleGetAutoObject "Excel.Application"

olePut (wApp, "visible", "true")

oleGet(wApp, "ActiveWorkBook", wDocs)

oleMethod (wDocs, "Add", args)

clear(args)

put (args, "C:\Export\" s) // choose a meaningful file path

oleMethod (wDocs, "SaveAs", args)


oleMethod(wApp, "Quit")

我导出了一个模块,但无法使用上面的 dxl 代码保存。在代码行

oleMethod (wDocs, "Add", args)

wDocs 返回空参数。导出 excel 未激活。 oleGet(wApp, "ActiveWorkBook", wDocs) 不工作。

如果我保存导出的 excel 文件,那么我可以用上面的代码更改文件名。 我也可以用上面的代码保存空白的新工作簿。但是从 DOORS 导出文件时它不起作用。该文件未变为活动状态。

以上dxl代码是正确的。它在 excel 2010 中运行良好,但在 excel 365 中运行不正常。它取决于 excel 版本。