P
Peter Smith
Hello,
how do I put a value in a cell in Excel XP
I'm programming an add-in, so all the variables (excelApp ..) work,
I'm just putting the code snipplets here.
click on the Add-in button in the toolbar executes a windows form. in
this form are a textbox and an ok button.
public void showButton_Click (Microsoft.Office.Core.CommandBarButton
barButton, ref bool somebool)
{
object temp1 = new object();
if (this.myAddin.ShowDialog() ==
System.Windows.Forms.DialogResult.OK)
{
temp1 = myAddin.textBox1.Text.ToString();
// note: this works! the value is there!
System.Windows.Forms.MessageBox.Show(temp1.ToString());
// why doesn't this work ? i know temp1 is there (the message
box)
// but the value isn't in the active excel cell.
excelApp.ActiveCell.Value2 = temp1;
}
}
can someone help me ?
cheers
-Peter
}
how do I put a value in a cell in Excel XP
I'm programming an add-in, so all the variables (excelApp ..) work,
I'm just putting the code snipplets here.
click on the Add-in button in the toolbar executes a windows form. in
this form are a textbox and an ok button.
public void showButton_Click (Microsoft.Office.Core.CommandBarButton
barButton, ref bool somebool)
{
object temp1 = new object();
if (this.myAddin.ShowDialog() ==
System.Windows.Forms.DialogResult.OK)
{
temp1 = myAddin.textBox1.Text.ToString();
// note: this works! the value is there!
System.Windows.Forms.MessageBox.Show(temp1.ToString());
// why doesn't this work ? i know temp1 is there (the message
box)
// but the value isn't in the active excel cell.
excelApp.ActiveCell.Value2 = temp1;
}
}
can someone help me ?
cheers
-Peter
}