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

OO.Calc Import question

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Calc
View previous topic :: View next topic  
Author Message
rparker
General User
General User


Joined: 15 May 2011
Posts: 6

PostPosted: Sun May 15, 2011 10:08 am    Post subject: OO.Calc Import question Reply with quote

In the past, I've used a DDE server to import live data into an OO.Calc spreadsheet. But now, I'm using static CSV files as the data sources and want to update individual cells in the spreadsheet automatically throughout the day on a server... unattended. I have all the CSV files updating from data getting scraped off of various websites at specific times. I'm also ready to write unique batch files to launch the spreadsheet and run a specific Macro at that time to update the value from the CSV in question using the following format in the batch files:

"C:\Program Files\OpenOffice.org 2.3\program\soffice.exe" "macro:///OOForum.Base.openForm2(Form11)"

Then, I just want to save and close the application at the end of the macro.

However, I've searched this forum (and it feels like I've gone to the moon and back, really) and I still haven't found a macro to do something like this: put the single value from a local CSV file into a specific cell in the spreadsheet. Then, it should save and close the spreadsheet until the next batch file runs for the next CSV. Again, there is only one row of information in each CSV. I just need to direct OO.Calc to import it to a specific cell.

I have some experience using MSSQL and have already looked at OO.Base because someone recommended that in another post for something like this. But I don't have enough data for this to be practical. I'm looking at 14 records total. So it seems like this should be done in OO.Calc directly. I just need to update this spreadsheet unattended 14 times a day.

Thanks for any help you can provide,

R
Back to top
View user's profile Send private message
rparker
General User
General User


Joined: 15 May 2011
Posts: 6

PostPosted: Sun May 15, 2011 11:51 am    Post subject: Update Reply with quote

I came across this thread and was wondering if PERL is how I should be approaching this rather than macros:

http://www.oooforum.org/forum/viewtopic.phtml?t=93417

I don't know Perl at all so if someone can help me understand what's required to complete my project, it'd be a big help.

My understanding right now is that PERL can parse CSV files. But how do I tell PERL where to input the data from the CSV to the spreadsheet? And then.. how do I save and close the spreadsheet?

I guess I'm going to start researching PERL but if anyone can point me in any direction, I'd appreciate it.

Thank you,

R
Back to top
View user's profile Send private message
rparker
General User
General User


Joined: 15 May 2011
Posts: 6

PostPosted: Sun May 15, 2011 7:05 pm    Post subject: Solved Reply with quote

I gave up on the macros. I'm writing scripts with AutoIt. It looks like this is exactly what I need.

Thanks,

R
Back to top
View user's profile Send private message
Villeroy
Super User
Super User


Joined: 04 Oct 2004
Posts: 10065
Location: Germany

PostPosted: Mon May 16, 2011 1:45 am    Post subject: Reply with quote

Well, you try to solve office problems by means of coding without really knowing the office application.

All you need is a database document as connector between your text files and your office documents (spreadsheets for instance). Has been described dozends of times. No coding, no DDE, no nothing.
http://user.services.openoffice.org/en/forum/viewtopic.php?f=75&t=18511
http://user.services.openoffice.org/en/forum/viewtopic.php?f=100&t=23727

Refreshing all database links in one go:
Code:
e=thisComponent.databaseRanges.createEnumeration()
while e.hasMoreElements
  dbr=e.nextElement()
  dbr.refresh()
wend

_________________
Rest in peace, oooforum.org
Get help on http://forum.openoffice.org
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 Calc 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