Hello Paul,
As described in the example, I change the code and still get the following
error:
error: cannot assign 'saNames' into 'WSheet.get_Range("F4","F5".Value2'
Excel.Application EXL;
EXL = new Excel.Application();
Excel.Worksheet WSheet = new Excel.WorksheetClass();
string FileName = MapPath(".") + "\\..xls";
WSheet = (Excel.Worksheet)EXL.Workbooks.Open(FileName, Type.Missing,
Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
Type.Missing).Worksheets.get_Item(1);
Excel.Range rng = WSheet.get_Range("H12", Type.Missing);
string H12 = "H12: " + rng.Value2.ToString();
string[,] saNames = new string[1,2];
saNames[0, 0] = "John";
saNames[0, 1] = "Smith";
WSheet.get_Range("F4", "F5").Value2 = saNames;
Thank you.
"Paul Clement" wrote:
> On Tue, 15 Feb 2005 06:51:04 -0800, "Dudi Nissan" <(E-Mail Removed)> wrote:
>
> ¤ Hi Paul,
> ¤ I read the article.
> ¤ Still I get an error message.
> ¤ According to my code, how can I assign value to the cell?
> ¤ Thank you.
> ¤
>
> The example I've seen implements the value2 property in C#. Perhaps that is what is missing from
> your assignment statement.
>
>
> Paul ~~~ (E-Mail Removed)
> Microsoft MVP (Visual Basic)
>