从(非托管)C ++调用XLL

时间:2022-09-01 09:34:12

I have an XLL Excel addin and now another team wants to use the same functionality in their project (unmanaged C++). Is there a way to interface with this XLL directly from C++?

我有一个XLL Excel插件,现在另一个团队希望在他们的项目中使用相同的功能(非托管C ++)。有没有办法直接从C ++与这个XLL接口?

2 个解决方案

#1


1  

Is you XLL un managed or unmanaged code?

你是XLL un托管代码还是非托管代码?

As far as I know, an unmanaged C++ XLL file is in fact a DLL that exports specific methods called by Excel.

据我所知,非托管C ++ XLL文件实际上是一个DLL,它导出Excel调用的特定方法。

If your XLL has a .def file, maybe you could add method that would be called by the other team.

如果你的XLL有.def文件,也许你可以添加其他团队调用的方法。

#2


1  

You can use GET.WORKSPACE(44) to get a list of the add-ins and their argument signatures. If you no hablo macro sheets, load xllutility.xll from http://sdrv.ms/JtaMIV and call =GET_WORKSPACE(44) in a cell. (Note the underscore.)

您可以使用GET.WORKSPACE(44)获取加载项及其参数签名的列表。如果你没有hablo宏表,请从http://sdrv.ms/JtaMIV加载xllutility.xll并在单元格中调用= GET_WORKSPACE(44)。 (注意下划线。)

The second column is the name of the function and the third is the argument list encoded as described here: http://msdn.microsoft.com/en-us/library/office/bb687900.aspx

第二列是函数的名称,第三列是按此处所述编码的参数列表:http://msdn.microsoft.com/en-us/library/office/bb687900.aspx

Use the handy adjust.xll from the link above to adjust the output to the correct size.

使用上面链接中的方便adjust.xll将输出调整为正确的大小。

#1


1  

Is you XLL un managed or unmanaged code?

你是XLL un托管代码还是非托管代码?

As far as I know, an unmanaged C++ XLL file is in fact a DLL that exports specific methods called by Excel.

据我所知,非托管C ++ XLL文件实际上是一个DLL,它导出Excel调用的特定方法。

If your XLL has a .def file, maybe you could add method that would be called by the other team.

如果你的XLL有.def文件,也许你可以添加其他团队调用的方法。

#2


1  

You can use GET.WORKSPACE(44) to get a list of the add-ins and their argument signatures. If you no hablo macro sheets, load xllutility.xll from http://sdrv.ms/JtaMIV and call =GET_WORKSPACE(44) in a cell. (Note the underscore.)

您可以使用GET.WORKSPACE(44)获取加载项及其参数签名的列表。如果你没有hablo宏表,请从http://sdrv.ms/JtaMIV加载xllutility.xll并在单元格中调用= GET_WORKSPACE(44)。 (注意下划线。)

The second column is the name of the function and the third is the argument list encoded as described here: http://msdn.microsoft.com/en-us/library/office/bb687900.aspx

第二列是函数的名称,第三列是按此处所述编码的参数列表:http://msdn.microsoft.com/en-us/library/office/bb687900.aspx

Use the handy adjust.xll from the link above to adjust the output to the correct size.

使用上面链接中的方便adjust.xll将输出调整为正确的大小。