VBA Excel: Compile Error: Object required?

前端 未结 2 1352
死守一世寂寞
死守一世寂寞 2021-02-13 18:26

I get a VBA Excel \'Compiler Error: Object required\'-Error in the marked line. I do not understand the reason.

BTW: Wish Excel would support a .Net language without wr

2条回答
  •  难免孤独
    2021-02-13 18:45

    Dim Data, refData As Inherit
    

    declares Data as Variant, only refData as Inherit.

    Dim Data As Inherit, refData As Inherit
    

    does what you want. The VBA syntax is not "common sense" here, I have seen this error dozens of times. EDIT: of course, you will have to leave out Set in the assignment, since Inherit is a user defined type.

    If you are looking for a free and easy to use .NET integration for Excel, look at Excel-DNA:

    http://exceldna.codeplex.com/

提交回复
热议问题