I want to transpose rows and columns of an excel sheet and save it. I want to use C# transpose() method for this purpose. Can anybody tell how it can be used in C# with exam
your method is part of the Excel object model but included in C# through Visual Studio Tools for Office / Excel DNA / Managed XLL etc
Object[,] transposedRange = (Object[,])xlApp.WorksheetFunction.Transpose(rng.Value2);
Then paste the transposedRange back into Excel:
xlApp.ActiveSheet.Range("A1").Resize(transposedRange.GetUpperBound(0), transposedRange.GetUpperBound(1)) = transposedRange;