Passing a VBA array to a C++ dll - Example Needed

  • Context: C/C++ 
  • Thread starter Thread starter CFDFEAGURU
  • Start date Start date
  • Tags Tags
    Array C++ Example
Click For Summary

Discussion Overview

The discussion revolves around the process of passing a VBA array to a C++ DLL, specifically seeking examples and clarification on how to implement this. The context includes programming and application development related to Excel and C/C++ integration.

Discussion Character

  • Technical explanation
  • Homework-related

Main Points Raised

  • One participant expresses frustration with a book on financial applications that lacks practical examples for passing arrays from VBA to C++, despite containing relevant information.
  • A request is made for a simple example demonstrating how to pass a 1-D array from VBA to C++, perform an operation, and return the values to VBA.
  • Another participant shares a link to a Microsoft support article that may provide useful information on the topic.
  • A later reply confirms that the method referenced works well, although the response time was slow.

Areas of Agreement / Disagreement

The discussion does not appear to reach a consensus on a specific example, but there is acknowledgment of a method that works for at least one participant. Multiple perspectives on the adequacy of resources and examples remain evident.

Contextual Notes

Participants express varying levels of satisfaction with existing documentation and examples, indicating potential limitations in available resources for this specific programming task.

CFDFEAGURU
Messages
781
Reaction score
10
Hi all,

In the book "Financial Applications Using Excel add-in Development in C/C++" 2nd edition by Steve Dalton in Section 3.7.2 Passing arrays and ranges from Excel to VBA to C/C++ and in that section a description of how this can be done is given. No example of how to do this is given and he refers to an "example.dll" that isn't provided. This book is horrible written but seems to have all the information buried in it some where.

Could anyone provide a simple example of how to pass a 1-D array or vector from VBA to C++ then do a simple operation on the passed array values and then return the array values to VBA?

Thanks.
 
Technology news on Phys.org
Hey CFDFEAGURU.

Have you seen this?

http://support.microsoft.com/kb/207931
 
chiro, no I didn't come across that one. Thank. I will see if I can use that.
 
Yes, that methods works perfect. Sorry for the very slow response.
 

Similar threads

  • · Replies 13 ·
Replies
13
Views
2K
  • · Replies 15 ·
Replies
15
Views
5K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 2 ·
Replies
2
Views
4K
Replies
3
Views
4K
  • · Replies 18 ·
Replies
18
Views
6K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 21 ·
Replies
21
Views
3K