To create a new workbook and add values to the first ten cells, complete the following steps:
To write code in Visual Basic
Visual Basic |
Copy Code
|
---|---|
Dim sheet As XLSheet = C1XLBook1.Sheets(0) Dim i As Integer For i = 0 To 9 sheet(i,0).Value = i + 1 Next i |
To write code in C#
C# |
Copy Code
|
---|---|
XLSheet sheet = c1XLBook1.Sheets[0]; for (int i = 0; i <= 9; i++) { sheet[i,0].Value = i + 1; } |
To write code in Visual Basic
Visual Basic |
Copy Code
|
---|---|
C1XLBook1.Save("c:\mybook.xls") System.Diagnostics.Process.Start("C:\mybook.xls") |
To write code in C#
C# |
Copy Code
|
---|---|
c1XLBook1.Save(@"c:\mybook.xls"); System.Diagnostics.Process.Start(@"C:\mybook.xls"); |