I have been writing some code to extract data from a an application and parse it to a spreadsheet.
My spreadsheet looks like this:
Scenario ClientName ClientNumber
5555 Smith s0001
6776 Charles d6666
I have this code:
Dim ObjExcel As New Excel.Application Dim sWindow As New WinWindow ObjExcel.Visible = False Dim stext As String
ObjExcel.Workbooks.Open("c:\data\calcresults.xlsx")
Dim ObjWS As Excel.Worksheet = ObjExcel.Worksheets("IP")
Dim iNextRow As Integer = ObjWS.UsedRange.End(Excel.XlDirection.xlDown).Row + 1
ObjWS.Cells(iNextRow,1 ) = "d66666"
ObjWS.Cells(iNextRow, 2) = "s77898"
would like use to Column Name not index, for example:
ObjWS.Cells(iNextRow,"Scenario" ) = "new row data, first column"
any ideas how can i do this?