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 8001163
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T16:01:02+00:00 2026-06-04T16:01:02+00:00

FYI 1: UDF = User Defined (Worksheet) Function FYI 2: XLL = Excel add-in

  • 0

FYI 1: UDF = User Defined (Worksheet) Function
FYI 2: XLL = Excel add-in (DLL -> XLL)

I am writing an XLL add-in for Excel in C/C++ using the Excel4() API from Microsoft.

Link: http://msdn.microsoft.com/en-us/library/bb687835.aspx

I have a “complicated” task that I want to use multiple threads for better performance. While I understand that calculation in Excel 2003 is single threaded, I want to know if my UDF can (a) spawn threads to do work, (b) wait for the threads to finish, and (c) return the result.

To be very clear, I will not do any Excel automation nor call Excel4() in the threads.

Pseudo code:

Variant MyComplexUDF(Variant input1, Variant input2)
{
    Thread t1 = new WorkerThread(input1);
    Thread t2 = new WorkerThread(input2);
    t1.join();
    t2.join();
    return [t1.Result(), t2.Result()];
}

On the surface, this appears OK, but I am not an expert on DLLs/XLLs and threading.

P.S. I have searched Google (high and low) for this answer, and cannot find anything on the matter.

  • 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-04T16:01:04+00:00Added an answer on June 4, 2026 at 4:01 pm

    You can start as many threads as you want and then wait on them. There is also support for async UDF’s in the latest version of the API. You can find some examples in http://xll.codeplex.com. Have a look at test/async.cpp: http://xll.codeplex.com/SourceControl/changeset/view/14528#139508

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

Sidebar

Related Questions

FYI - this query runs from excel. i have prompt fields to set date
* FYI: I'm not using Adsense and this is not against my TOS... I
This code trims whitespace, (fyi: it's credited to be very fast) function wSpaceTrim(s){ var
FYI: SQL Server 2005 I have a database user account (user_web) that has the
I am unable to retrieve Status using FQL for Some Users...for Most of User
FYI, I'm working on my first MVC web application using MVC 3 and Razor
I'm considering using Django for a project I'm starting (fyi, a browser-based game) and
I have a very strange problem. (fyi - I'm using forms authentication and manually
Consider that I have 10 input boxes, (using datepicker plugin Fyi) I have a
I was trying to export a simple test function for a dll to work

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.