excel vba - Getting a Type Mismatch error when passing SeriesCollection object -
already searched web problem no luck. using excel 14.0 , though hate using vba charting purposes, have no choice. need update literally dozens of charts. excel doesn't offer easy way of doing this, illustration find replace on source info ranges.
maybe getting sophisticated vba. know has limits, pass objects time without problems. here trying do. seems simple enough. can't seem pass seriescollection object. tried byref, byval, both give type mismatch error. tried without with/end block. made sure seriescollection argument throwing off error. guess pass chart object , integer seriescollection, that's many variables imo.
sub mcrmycode1() activechart phone call mcrseriesmod(.seriescollection(1), "hd", "ho", "avg", 34, 57) end end sub sub mcrmycode2() phone call mcrseriesmod(activechart.seriescollection(1), "hd", "ho", "avg", 34, 57) end sub sub mcrmodseries(byref seriesmod seriescollection, _ byval sstcol string, _ byval sendcol string, _ byval stitle string, _ byval ixrow integer, _ byval iyrow integer) seriesmod .xvalues = "=sheet1!$" & sstcol & "$" & ixrow & ":$" & sendcol & "$" & ixrow .values = "=sheet1!$" & sstcol & "$" & iyrow & ":$" & sendcol & "$" & iyrow .name = stitle end end sub excel-vba
No comments:
Post a Comment