Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Problem with optional parameters in Excel Automation Add-in worksheet function

I'm developing an Office Automation Add-in in C++/ATL (Visual Studio
..NET 2003) that exposes an Excel worksheet function. The function
takes 13 input parameters and I need 9 to be optional. I used the
optional attribute for the parameters in the IDL function declaration:

[id(1), helpstring("method TestFunction")] HRESULT TestFunction([in]
VARIANT RequiredParam1, [in] VARIANT RequiredParam2, [in] VARIANT
ArgumentList, [in] VARIANT Argument1, [in, optional] VARIANT
Argument2, [in, optional] VARIANT Argument3, [in, optional] VARIANT
Argument4, [in, optional] VARIANT Argument5, [in, optional] VARIANT
Argument6, [in, optional] VARIANT Argument7, [in, optional] VARIANT
Argument8, [in, optional] VARIANT Argument9, [in, optional] VARIANT
Argument10, [out,retval] VARIANT* returnValue);

When I run Excel the function shows up correctly. The function window
shows the first 4 parameters names in bold (meaning required) and the
rest not in bold but my code doesn't get called unless I fill in all
the parameters. I created Microsoft's sample Visual Basic Automation
Add-in, http://support.microsoft.com/default.aspx?kbid=285337, that
has a function with an optional parameter and the sample worked
correctly. I also tried calling my method from VB and that also worked
correctly (I didn't have to supply the optional parameters). Does
anyone have any idea what's wrong with Excel calling my method?


Thanks,
Mike Gilkeson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel problem - sumif with multiple parameters athletico Excel Worksheet Functions 2 July 7th 08 12:02 PM
Excel 2003 c++ automation problem. Ken Excel Worksheet Functions 0 January 9th 07 12:13 AM
RP - Office 2000 automation parameters Access and excel Matt. Excel Programming 5 December 16th 03 07:55 PM
Office 2000: excel to access automation and parameters Matt. Excel Programming 0 December 15th 03 09:33 PM
addin problem: sheet mismatch by function parameters berrie Excel Programming 0 December 12th 03 11:21 AM


All times are GMT +1. The time now is 01:40 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"