OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

C# enter datetime values in calc

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
dj dourak
Newbie
Newbie


Joined: 08 Jun 2010
Posts: 1

PostPosted: Tue Jun 08, 2010 5:58 am    Post subject: C# enter datetime values in calc Reply with quote

Hi, I created a windows form which collects user input in order to store it in 4 different calc files. I used this code:
Code:
StringBuilder name=new StringBuilder ("");
            XCell oCell;
            byte y=0;

            do
                {
                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)?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group