In order to use Databeam Excel .Net in your application, you must first add a reference to it:
1.
In Solution Explorer (VisualStudio.Net) , expand the project node you want to add a reference to.
2.
Right-click the References node for the project and select Add Reference from the shortcut menu:
3.
Locate the component using the Browse button.
4.
The component you referenced appears in the SelectedComponents pane of the dialog box:
5. Click OK when you have added reference to the component.
1using System; 2 3namespace Project1 4{ 5 public class Class1 6 { 7 static void Main() 8 { 9 Console.Write("Converting XLS to HTML: \n"); 10 DuoDimension.Databeam.Excel conv = new DuoDimension.Databeam.Excel(""); 11 if (conv.IsExcelInstalled) 12 { 13 if (conv.OpenXls(@"d:\test.xls") == 0) 14 { 15 int ret = conv.XlsToHtml(@"d:\test.html"); 16 switch (ret) 17 { 18 case 0: 19 { 20 for (int i = 1; i <= conv.Sheets.Length; i++) 21 Console.Write(i.ToString() + ": " + conv.Sheets[i-1] + "\n"); 22 Console.Write("...Ok."); break; 23 } 24 case 1: Console.Write("...error: can't open file."); break; 25 case 2: Console.Write("...error: can't save the destination file."); break; 26 } 27 } 28 } 29 } 30 } 31}
1Module Module1 2 Sub Main() 3 Console.Write("Converting XLS to HTML: \n") 4 Dim conv As New DuoDimension.Databeam.Excel("") 5 6 If conv.IsExcelInstalled = True Then 7 If conv.OpenXls("d:\test.xls") = 0 Then 8 Dim ret = conv.XlsToHtml("d:\test.html") 9 Select Case ret 10 Case 0 11 For i As Integer = 1 To i <= conv.Sheets.Length 12 Console.Write(i.ToString() + ": " + conv.Sheets(i - 1) + "\n") 13 Next i 14 Console.Write("...Ok.") 15 Case 1 16 Console.Write("...error: can't open file.") 17 Case 2 18 Console.Write("...error: can't save the destination file.") 19 End Select 20 End If 21 End If 22 End Sub 23End Module