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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T21:01:16+00:00 2026-06-14T21:01:16+00:00

After long hours of investigation on exposing C# property that accepts a reference type

  • 0

After long hours of investigation on exposing C# property that accepts a reference type to VBA, I concluded that it was not possible. In brief, a C# property that is of type double[] or even an object cannot be consumed in VBA like this:

' Compile Error: Function or interface marked as restricted,
' or the function uses an Automation type not supported in Visual Basic
oComExposedEarlyBinding.ObjectArray = VBArray

' Run-time error 424: Object required
oComExposedEarlyBinding.PlainObject = VBArray

Or for more details:
C# property exposed to VBA (COM) : Run-time error '424': Object required

I would like to know if C++/CLI would support such an option? i.e.
Allowing a reference-type property to be exposed to VBA so that a
syntax like the above is valid.

N.B. You can achieve this by using late binding, but losing the intellisense is not an option.

  • 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-14T21:01:16+00:00Added an answer on June 14, 2026 at 9:01 pm

    This is possible in C++/CLI because the property in C++/CLI is composed of two functions a get and a set and in C++/CLI you CAN have a reference function (versus a pointer one).

    The same property that is exposed in a similar way in C# won’t work.

    This property is exposed as expected to COM and there will be no issue setting or getting in VBA:

    private:
        Object ^_myProp;
    public:
    property Object %MyProp { 
        virtual Object %get() 
        {
            return *_myProp;
        }
        virtual void set(Object %value) 
        {
            _myProp = %value;
        }
    };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

after hours of tracking mysterious one or two seconds long lasting freeze I finally
After a long investigation on how to use TFS 2010 I started with the
I am working on a new project on roundcube and after long hours of
I am trying to use a stored long-life access token, but after 2 hours
After long searches, I succeed to delete a row in a jqgrid with form
After a long search I'm still confused about it although I found some related
After a long time searching and trying I'm asking now for help: My situation:
How long after a document is fed to the Google Search Appliance using a
I am returning to C++ after a long absence and I am stumbling a
I'm currently re-engaging with Python after a long absence and loving it. However, I

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.