[RESOLVED] Problems with Excel Code
Hallo Friends!
I wanted to Change the following VB.net code to C#
Code:
Dim BestArray(,) As Object
'I'm calling a method which fills the Excel sheet in a very short time
' 100.000 lines with 12 columns within 9 seconds
Call ArrFillFromTopLeft(ws.Range(ws.Cells._Default(startRow, 1), ws.Cells._Default(startRow + 9, 11)), BestArray)
' The method itself Looks like
Public Sub ArrFillFromTopLeft(ByRef R As Excel.Range, ByRef Arr As Object)
'fills an entire Array from a single TopLeft-Cell-Range
R.Resize(ArrRowCount(Arr), ArrColCount(Arr)).Value = Arr
End Sub
I dont get a solution to port this VB.NET Code to C#
Anyone has an Idea how to translate this in C# because you don't have any similar methods there which you have in VB.NET Thx for any suggestions in before :wave:
Re: Problems with Excel Code
I had found an relativly easy Approach to handle that Problem.
I created a Libraryusing exactly that methods. written in VB.NET so I did bnot have prblems with the code itself
because he VB.NET code I aready had.
Then I simple used that dll referenced it in y C# program so I can use that methods.
Now most of my code is inC#whil only this dll containing some method accesing Excel.Range objects are written in VB.Nt.
Tested Works.