Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / December 2004

Tip: Looking for answers? Try searching our database.

Excel Automation Add-In Functions and C# question

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Emmanuel - 13 Dec 2004 08:33 GMT
Hi,

I am building an Excel automation Add-In function using C#.
(Excel 2003, Windows XP, Visual Studio.NET 2003).

My function has the following form:

public decimal function1( int param1, int param2 );

What if I want to return an ERROR to Excel ?
How is error handling performed ?

My function returns a decimal, so I cannot return the error message as the
return value...

Please help

Thanks
Emmanuel
"Peter Huang" [MSFT] - 14 Dec 2004 08:26 GMT
Hi,

Now I am researching the issue and we will reply here with more information
as soon as possible.
If you have any more concerns on it, please feel free to post here.

Thanks for your understanding!

Best regards,

Peter Huang
Microsoft Online Partner Support

Signature

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

"Peter Huang" [MSFT] - 16 Dec 2004 03:18 GMT
Hi

So far I am keeping researching the issue, and I will get back here and
reply to you ASAP.

Best regards,

Perter Huang
Microsoft Online Partner Support

Signature

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

"Peter Huang" [MSFT] - 17 Dec 2004 06:19 GMT
Hi

So far I am contacting relative supporting Team, and we will reply to you
ASAP.
Thanks for your understanding!

Best regards,

Perter Huang
Microsoft Online Partner Support

Signature

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

"Peter Huang" [MSFT] - 21 Dec 2004 06:16 GMT
Hi

So far we are still researching the issue sorry for the delayed response.
We will reply to you ASAP.

Thanks for your patient.

Best regards,

Perter Huang
Microsoft Online Partner Support

Signature

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

"Peter Huang" [MSFT] - 23 Dec 2004 08:31 GMT
Hi

I am sorry for delay result.
After we did further detailed troubleshooting, it seems that the Excel use
a different error handle mechanism.
So far to do the job, we need to manual wrap the COM hresult error manually.
We can return the error as below.
public object f()
{
    //return #DIV/0! to excel
    return new ErrorWrapper(unchecked((int)0x800a07d7)); // this will cause
the #DIV/0! error in the Excel.
}

Following are the HRESULT for the VT_ERROR:

#NULL!     0x800a07d0
#DIV/0!    0x800a07d7
#VALUE!   0x800a07df
#REF!       0x800a07e7
#NAME?    0x800a07ed
#NUM!      0x800a07f4
#N/A        0x800a07fa

If you still have any concern, please feel free to post here.

Best regards,

Perter Huang
Microsoft Online Partner Support

Signature

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Emmanuel - 23 Dec 2004 09:39 GMT
Thanks Peter.

> Hi
>
[quoted text clipped - 31 lines]
> This posting is provided "AS IS" with no warranties, and confers no
> rights.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.