vba - class string array property cannot be read -


i'm using excel 2013.

i have class called clsfund. has 1 property of type string() called companynames.

 private pconame() string   public property companynames() string()     companynames = pconame  end property 

in standard module try retrieve string array without luck. have code below. funny thing ubound tells me correct answer of 10 doesn't line below clsdata.pnl, method expecting string argument belive have supplied compile error: wrong number of arguments or invalid property assignment - not understand?

 private sub printcompanynameandpnl()   dim integer   = 1 ubound(fund.bloombergindices)      range("a" & i) = clsdata.pnl(fund.companynames(i))                      next 

end sub

if write way, passing i parameter companynames property, doesn't accept arguments.

you need access array items this:

range("a" & i) = clsdata.pnl(fund.companynames()(i))  

so returning array , passing i index that.


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -