COM Excel Addin:在COM Addin初始化之前调用RTD ConnectData [英] COM Excel Addin : RTD ConnectData being called before COM Addin initialization

查看:48
本文介绍了COM Excel Addin:在COM Addin初始化之前调用RTD ConnectData的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正面临Excel Addin的问题。我有两个< g class =" gr_ gr_39 gr-alert gr_gramm gr_run_anim Style multiReplace"数据-GR-ID =" 39" id =" 39"> versions  one< / g>使用IDTExtensibility2和其他的是
基于VSTO< g class =" gr_ gr_29 gr-alert gr_spell gr_run_anim ContextualSpelling ins-del multiReplace"数据-GR-ID =" 29" ID = QUOT; 29">插件< / g取代。我们有一个COM库,我们通过
regsvr32注册为RTD Server和Excel。注册在安装excel时进行< g class =" gr_ gr_46 gr-alert gr_spell gr_run_anim ContextualSpelling ins-del multiReplace"数据-GR-ID =" 46" id =" 46"> addin< / g>


上述两个版本都会出现以下问题。


当我运行excel时命令提示符并打开包含UDF的工作表 


启动excel.exe" filename"


在这种情况下,RTD服务器调用Server_Start和ConnectData在我的< g class =" gr_ gr_57 gr-alert gr_spell gr_run_anim ContextualSpelling ins-del multiReplace"之前数据-GR-ID =" 57" ID = QUOT; 57">插件< / g取代;初始化[
Addin Startup /OnConnection]。我已将检查放在我的< g class =" gr_ gr_65 gr-alert gr_spell gr_run_anim ContextualSpelling ins-del multiReplace"之前不计算UDF。数据-GR-ID =" 65 QUOT; ID = QUOT; 65 QUOT;>插件< / g取代;初始化。


因此,我需要在初始化后重新计算工作表上的所有公式。但ExcelApplication.CalculateFull不会触发RTD.ConnectData,我的所有公式都计算为#NA


有关如何在工作表上重新计算UDF的任何建议。


谢谢


K Arora





解决方案


>>当我通过命令提示符运行excel并打开包含UDF的工作表


如果手动打开excel,这个问题是否存在?


怎么做?您在VSTO解决方案中使用RTD.ConnectData?如果您可以分享我们的演示项目和详细步骤,那么我们可以尝试重现您的问题。


最好的问候,


爱德华


I am facing an issue with Excel Addin. I have two <g class="gr_ gr_39 gr-alert gr_gramm gr_run_anim Style multiReplace" data-gr-id="39" id="39">versions  one</g> which uses IDTExtensibility2 and other is the VSTO based <g class="gr_ gr_29 gr-alert gr_spell gr_run_anim ContextualSpelling ins-del multiReplace" data-gr-id="29" id="29">addin</g>. We have a COM Library which we have registered as RTD Server with Excel through regsvr32. The registration takes place at time of installation of excel <g class="gr_ gr_46 gr-alert gr_spell gr_run_anim ContextualSpelling ins-del multiReplace" data-gr-id="46" id="46">addin</g>

The following issue occurs with both the above versions.

When I run excel through command prompt and open a sheet which contains UDF 

start excel.exe "filename"

In this case, RTD Server calls Server_Start and ConnectData before my <g class="gr_ gr_57 gr-alert gr_spell gr_run_anim ContextualSpelling ins-del multiReplace" data-gr-id="57" id="57">addin</g> is initialized [ Addin Startup /OnConnection].I have placed checks not to calculate UDF before my <g class="gr_ gr_65 gr-alert gr_spell gr_run_anim ContextualSpelling ins-del multiReplace" data-gr-id="65" id="65">addin</g> is initialized.

Hence, I need to re-calculate all the formulae on my sheet after the initialization.But ExcelApplication.CalculateFull does not trigger RTD.ConnectData and all my formulae calculate to #NA

Any suggestions on how I can re-calculate the UDF on the sheet.

Thanks

K Arora

解决方案

Hi,

>> When I run excel through command prompt and open a sheet which contains UDF

If you manually open the excel, will this issue exist?

How did you use RTD.ConnectData in VSTO solution? It would be helpful if you could share us demo project and detail steps, and then we could try to reproduce your issue.

Best Regards,

Edward


这篇关于COM Excel Addin:在COM Addin初始化之前调用RTD ConnectData的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆