Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9020193
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T04:57:24+00:00 2026-06-16T04:57:24+00:00

Context: Windows 7, ExcelDNA 0.30, .NET 4.0 I’m still trying to get a params/ParamArray

  • 0

Context: Windows 7, ExcelDNA 0.30, .NET 4.0

I’m still trying to get a params/ParamArray approach working in Excel via ExcelDNA. By using varags, I’m avoiding anything to do with System.ParamArrayAttribute and pursuing a path with System.ArgIterator.

The sad fact is that the following compiles but still doesn’t work. I keep getting value errors. Something’s amiss but I don’t know enough of this assembler (yet) to figure it out. Any ideas, anyone??

.assembly extern mscorlib { } 
.assembly Test {} 
.module test.dll
.namespace VTest {
    .class public Test { 
        // Compute sum of undefined number of arguments 
        .method public static vararg int64 IntSum(/* all arguments optional */) 
        { 
            .locals init(valuetype [mscorlib]System.ArgIterator Args, 
                        unsigned int64 Sum, 
                        int32 NumArgs) 
            ldc.i8 0 
            stloc Sum    


            ldloca Args 
            arglist // Create argument list structure  
            // Initialize ArgIterator with this structure: 
            call instance void [mscorlib]System.ArgIterator::.ctor( 
               value class [mscorlib]System.RuntimeArgumentHandle) 

            // Get the optional argument count: 
            ldloca Args 
            call instance int32 [mscorlib]System.ArgIterator::GetRemainingCount() 
            stloc NumArgs 

            // Main cycle: 
          LOOP: 
            ldloc NumArgs 
            brfalse RETURN // if(NumArgs == 0) goto RETURN; 

            // Get next argument: 
            ldloca Args 
            call instance typedref [mscorlib]System.ArgIterator::GetNextArg() 

            // Interpret it as unsigned int64: 
            refanyval [mscorlib]System.UInt64 
            ldind.u8 

            // Add it to Sum: 
            ldloc Sum 
            add 
            stloc Sum // Sum += *((int64*)&next_arg) 

            // Decrease NumArgs and go for next argument: 
            ldloc NumArgs 
            ldc.i4.m1 
            add 
            stloc NumArgs 
            br LOOP 

          RETURN: 
            ldloc Sum 
            ret 
        } 

    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T04:57:25+00:00Added an answer on June 16, 2026 at 4:57 am

    Excel-DNA (and the Excel C API) currently does not support (version 0.30) the ‘params’ optional parameters. See this discussion for more details and possible workarounds: http://exceldna.codeplex.com/discussions/406719

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Context Language: C# Platform Version: Microsoft .Net Framework 4.0 Operating System: Windows 7 Professional
I am trying to invoke an ANT target from Windows (right-click) file context menu.
I have a Windows context menu item invoking a Windows Form via these registry
I have a class library used in windows (WPF) and web (ASP.NET) context. The
I'm trying to implement Copy as path option in windows context menu ,which copies
This might be a Windows 7 issue, but calling using (var context = new
I have an application which runs using the context menu of windows explorer. I
I'm creating an OpenGL render context on Windows, using ChoosePixelFormat, SetPixelFormat, etc. This all
i have added an item in the context menu of windows explorer using registry.
I've been developing a windows forms application in C# (.net framework 4) and trying

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.