Read the ActiveCell content in Excel using VSTO

耗尽温柔 提交于 2019-12-01 23:43:44

R.Text.ToString(); will get you the text from the cell

Do not use Activewindow. modified your code as follows Excel.Range R = this.Application.ActiveCell as Excel.Range; if (R != null) MessageBox.Show(R.Value2);

Note: ActiveCell can be null if user have not chosen a cell in the active sheet.

Is this of any use: http://social.msdn.microsoft.com/Forums/en-US/vsto/thread/f21c7cf4-fbfd-4496-a593-781eb751d580

It suggests turning off proxies for debugging purposes, hinting that the error message you are seeing may be masking a lower level COM error.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!