Joined: 08 Jun 2010
|Posted: Tue Jun 08, 2010 5:58 am Post subject: C# enter datetime values in calc
|Hi, I created a windows form which collects user input in order to store it in 4 different calc files. I used this code:
|StringBuilder name=new StringBuilder ("");
name.Remove (0, name.Length);
oCell=oSheet.getCellByPosition (1, ++y);
name.Append (((XText) oCell).getString ());
while (name.ToString ()!="");
((XText) oCell).setString (nameComplete);
oCell=oSheet.getCellByPosition (0, y);
I used the .getCellByPosition (x,y) to identify the target cell and .setString or .setValue to enter a value.
The problem is that .setString accepts string and .setValue accepts doubles only. What if I want to enter other data like DateTime? Actually that's what I want to do...
Also, I used a do-while loop to check for the first blank cell in a column. Is there an easier (and faster) way to do that (like an api)?