This is the VBA code for an Excel template that I am trying to convert to C # in the VSTO project I'm working on. By the way, this is a VSTO add-in:
Dim addedShapes() As Variant
ReDim addedShapes(1)
addedShapes(1) = aBracket.Name
ReDim Preserve addedShapes(UBound(addedShapes) + 1)
addedShapes(UBound(addedShapes)) = "unique2"
Set tmpShape = Me.Shapes.Range(addedShapes).Group
At this moment I am puzzled addedShapes(), not sure what it is.
Update: Matti mentioned what addedShapes()a variant array is in VBA. So now I wonder what should be in the content addedShapes(). Would this be the correct way to call Shapes.Range () in C #?
List<string> addedShapes = new List<string>();
...
Shape tmpShape = worksheet.Shapes.get_Range
(addedShapes.Cast<object>().ToArray()).Group();
I would be grateful to everyone who worked with VBA and C # to comment on my questions and problems!
source
share