01.
using
Microsoft.Office.Interop.Excel;
02.
using
System;
03.
using
System.Collections.Generic;
04.
using
System.ComponentModel;
05.
using
System.Data;
06.
using
System.Data.OleDb;
07.
using
System.Drawing;
08.
using
System.Linq;
09.
using
System.Text;
10.
using
System.IO;
11.
using
System.Threading;
12.
using
System.Windows.Forms;
13.
14.
namespace
Planing
15.
{
16.
public
partial
class
MainForm1 : Form
17.
{
18.
Microsoft.Office.Interop.Excel.Application _xlApp =
new
Microsoft.Office.Interop.Excel.Application();
19.
Microsoft.Office.Interop.Excel.Workbook _wb =
new
Microsoft.Office.Interop.Excel.Workbook();
20.
Microsoft.Office.Interop.Excel.Worksheet _wk =
new
Microsoft.Office.Interop.Excel.Worksheet();
21.
Microsoft.Office.Interop.Excel.Range _ra =
new
Microsoft.Office.Interop.Excel.Range();
22.
23.
24.
25.
26.
public
Form1()
27.
{
28.
InitializeComponent();
29.
}
30.
31.
private
void
Form1_Load(
object
sender, EventArgs e)
32.
{
33.
34.
_xlApp =
new
Microsoft.Office.Interop.Excel.Application();
35.
_wb = _xlApp.Workbooks.Add(1);
36.
_wk = _wb.Worksheets(1);
37.
38.
39.
accepting a first argument of type
'Microsoft.Office.Interop.Excel.Workbook'
40.
could be found (are you missing a
using
directive or an assembly reference?)
41.
42.
43.
_ra = _wk.Range(
"A1"
);
44.
_ra.Value =
"Hello World"
;
45.
_xlApp.Visible =
true
;
46.
}
47.
48.
}
49.
50.
51.
52.
53.
54.
Error 2
'Point'
is
an ambiguous reference between
'Microsoft.Office.Interop.Excel.Point'
and
'System.Drawing.Point'
55.
56.