i have absolutely no idea why cannot add hyperlink shape if trigged in-cell function. when run manually immediate window, working well. don't have troubles doing manually. i have no idea how write error handling in vba this sample code. function testcase(xllabelname string) dim sht worksheet each sht in activeworkbook.sheets if shapeexist(sht, xllabelname) sht.hyperlinks.add anchor:=sht.shapes(xllabelname), address:="", subaddress:="a1" testcase = "bingo" end if next sht end function from immediate window bingo answer , in cell #arg! error , line not executed. tried ungroup shapes first using dim gshp shape dim shrng shaperange dim tmp string set gshp = sht.shapes(getparentshape(xllabelname)) tmp = gshp.name set shrng = gshp.ungroup sht.hyperlinks.add anchor:=sht.shapes(xllabelname), address:="", subaddress:="a1" shrng.regroup shrng.name = tmp but failed. , still im...
Comments
Post a Comment