Excel Problem

Add-in Express™ Support Service
That's what is more important than anything else

Excel Problem
 
Alfred Dworschak




Posts: 13
Joined: 2007-03-06
dear AIE-Team,

I am facing a real weird problem in excel. if I want to print the current worksheet everything works fine if I don't select any text. But if the cursor is within one cell, selecting a text, then add-inn-express throws an error

Detailed technical information follows:
---
(Inner Exception)
Date and Time: 19.03.2007 20:37:18
Machine Name: MOCTIRIPS
IP Address: 192.168.30.20
Current User: MOCTIRIPS\Administrator

Application Domain: C:\Programme\Add-in Express\Add-in Express 2007 for .NET Premium\Docs\Samples\Your First Microsoft Office COM Add-in\VS2005\C#\MyAddin1\bin\Release\
Assembly Codebase: file:///C:/WINDOWS/assembly/GAC_MSIL/AddinExpress.MSO.2005/3.3.1867.2005__c20c070a1fc9a144/AddinExpress.MSO.2005.dll
Assembly Full Name: AddinExpress.MSO.2005, Version=3.3.1867.2005, Culture=neutral, PublicKeyToken=c20c070a1fc9a144
Assembly Version: 3.3.1867.2005
Assembly Build Date: 10.02.2005 01:06:50

Exception Source: Interop.Excel
Exception Type: System.Runtime.InteropServices.COMException
Exception Message: Ausnahme von HRESULT: 0x800A03EC
Exception Target Site: set_EditDirectlyInCell

---- Stack Trace ----
Excel._Application.set_EditDirectlyInCell(RHS As Boolean)
AddinExpress.MSO.2005.dll: N 00000 (0x0) JIT
MyAddin1.AddinModule.printItem(application As String)
AddinModule.cs: line 0380, col 17, IL 0124 (0x7C)
MyAddin1.AddinModule.adxCommandBarButton1_Click(sender As Object)
AddinModule.cs: line 0217, col 21, IL 0060 (0x3C)
MyAddin1.AddinModule.adxRibbonButton1_OnClick(sender As Object, control As IRibbonControl, pressed As Boolean)
AddinModule.cs: line 0299, col 13, IL 0000 (0x0)
AddinExpress.MSO.ADXRibbonButton.DoInternalAction(e As ADXRibbonOnActionEventArgs)
AddinExpress.MSO.2005.dll: N 0023 (0x17) IL



(Outer Exception)
Date and Time: 19.03.2007 20:37:18
Machine Name: MOCTIRIPS
IP Address: 192.168.30.20
Current User: MOCTIRIPS\Administrator

Application Domain: C:\Programme\Add-in Express\Add-in Express 2007 for .NET Premium\Docs\Samples\Your First Microsoft Office COM Add-in\VS2005\C#\MyAddin1\bin\Release\
Assembly Codebase: file:///C:/WINDOWS/assembly/GAC_MSIL/AddinExpress.MSO.2005/3.3.1867.2005__c20c070a1fc9a144/AddinExpress.MSO.2005.dll
Assembly Full Name: AddinExpress.MSO.2005, Version=3.3.1867.2005, Culture=neutral, PublicKeyToken=c20c070a1fc9a144
Assembly Version: 3.3.1867.2005
Assembly Build Date: 10.02.2005 01:06:50

Exception Source:
Exception Type: AddinExpress.MSO.ADXExternalException
Exception Message: Error occured in the code of the add-in.
Exception Target Site: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.

---- Stack Trace ----


any idea???

regards

alfred
Posted 19 Mar, 2007 14:48:38 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Alfred.

You can't print anything until Excel is in the edit mode.
But you can call the SendKeys method to disable the edit mode and print the current worksheet.

E.g.
private Timer timer1;

private void adxCommandBarButton1_Click(object sender)
{
ExcelApp.SendKeys("^{ENTER}", true);
timer1.Enabled = true;
}

private void timer1_Tick(object sender, EventArgs e)
{
timer1.Enabled = false;
// here you can print something.
}

P.S. Note that we take up your forum requests in the order we receive them.
Besides, it may take us some time to investigate your issue. Please be sure we will let you know as soon as the best possible solution is found.
Posted 20 Mar, 2007 05:45:38 Top