BBC BASIC for Windows
Programming >> Database and Files >> LibreOffice Calc http://bb4w.conforums.com/index.cgi?board=database&action=display&num=1416693769 LibreOffice Calc
Post by g3nrw on Nov 22nd, 2014, 9:02pm
I plan to write a BB4W program that reads data from a COM port and saves it in a LibreOffice Calc spreadsheet. Ideas/techniques/example code for accessing the Calc data structures anyone?
-- Ian Re: LibreOffice Calc
Post by rtr2 on Nov 22nd, 2014, 9:31pm
I plan to write a BB4W program that reads data from a COM port and saves it in a LibreOffice Calc spreadsheet.
Will a CSV (or tab-separated) file meet your requirements? I'm presuming LibreOffice will read such a file - MS Excel definitely will - and if so it would be the simplest solution.
Richard.
Re: LibreOffice Calc
Post by g3nrw on Nov 23rd, 2014, 06:05am
Not really.
What I have in mind is replicating an Excel VBA app I wrote some time ago, but now want to rewrite for LibreOffice to make the functionality available for people who don't have Excel.
In essence, the app displays a spreadsheet, and has several buttons, including a CONNECT and a READ button. After CONNECTing to the external device, the program READs data and plugs it into individual spreadsheet cells in real time.
To do this, I need to know how to make BB4W identify and write into individual Calc cells. As Calc and BB4W executables are separate entities (as opposed to Excel which is tightly integrated with VBA), it may not be practical to do what I want. At this time I am just wondering if anyone here has done anything broadly similar.
-- Ian Re: LibreOffice Calc
Post by rtr2 on Nov 23rd, 2014, 09:36am
You will find the answers there. Sounds like an interesting challenge, but it shouldn't be too difficult. If you've not used COMLIB before I would recommend studying the relevant section of the main Help docs and working through the examples on the wiki: