You can’t do the reference : other cell in the first tab is update with #REF
Way to reproduce it:
I use the Andrew Whitechapel’s project : Implementing IMessageFilter in an Office add-in
http://blogs.msdn.com/andreww/archive/2008/11/19/implementing-imessagefilter-in-an-office-add-in.aspx
I change the following lines of codes:
private void CallExcel()
{
try
{
this.Application.ActiveCell.Value2 = DateTime.Now.ToShortTimeString();
}
…..
By
private void CallExcel()
{
try
{
this.Application.StatusBar= DateTime.Now.ToShortTimeString();
}
….
And:
private void RegisterFilter()
{
// Message filters are per-thread, so we register this thread
// as a message filter (not the main thread that the add-in is
// created on - because that's Excel's main thread).
CoRegisterMessageFilter(this, out oldMessageFilter);
// Sleep for long enough so the user can pop up a dialog in Excel,
// to make sure Excel is blocked.
Thread.Sleep(3000);
CallExcel();
}
By
private void RegisterFilter()
{
// Message filters are per-thread, so we register this thread
// as a message filter (not the main thread that the add-in is
// created on - because that's Excel's main thread).
CoRegisterMessageFilter(this, out oldMessageFilter);
// Sleep for long enough so the user can pop up a dialog in Excel,
// to make sure Excel is blocked.
while (true)
{
Thread.Sleep(200);
CallExcel();
}
}
When you click on AsyncCall menu in the Rubbon, it start trying to put the hour in the status bar.
If you try to reference a cell in another tab, you will receive nothing & another cell will be updated with #REF value or 0