I’ve run across the following line in a VB6 application.
mobjParentWrkBk.ExcelWorkBook.Application.Selection.Insert Shift:=xlToRight
Unfortunately Google and other search engines have not been very useful as they seem to omit the := part.
What would be a C# equivalent?
This is Visual Basic syntax for optional named parameters. The
Insertfunction has a parameter namedShift, which is being specified.C#, as far as I know, doesn’t have an equivalent for optional named parameters. Instead, you’d need to call the
Insertmethod, specifyingType.Missingfor all parameters other thanShift.See also the following StackOverflow question: VB.NET := Operator
UPDATE (2008-10-29):
C# 4.0 is set to introduce optional and named parameters. See this blog entry on codebetter.com.