I guess you can try create a safearray from a J array by imitating the example in the msexcel.ijs script.
On 10 Jul, 2013, at 7:28 PM, David Mitchell <davidmitch...@att.net> wrote: > I have not used these functions in J, but the doc I found on the web suggests > that these may be some of the OpenOffice functions that you could use: > > (VB example to copy a range of cells) > > oRange = oSheet.getCellRangeByName("A1:C1") > da = oRange.getDataArray > oRange = oSheet.getCellRangeByName("B1:B5") > oRange.setDataArray(da) > > Also: > > getFormulaArray and setFormulaArray will transfer numbers, text and formulas > > I do not know how you would construct the data structure 'da' referenced in > these examples using individual data elements in J. I suspect that it would > take some trial and error to figure that out. > > Good luck, > David > > On 7/10/2013 5:12, Mike Day wrote: >> Spasibo, Bill. Trouble with that idea is that I probably won't understand >> the >> answer! >> Whoever wrote wdooo might know how and could add a couple of example lines to >> the "test" verb. >> I DID find that you can get an instance of a named worksheet for read/write >> using 'getByName' rather than 'getByIndex' . >> Your correspondence with David Mitchell suggested you are both well up on >> this >> stuff! >> >> Cheers, >> >> Mike >> >> On 10/07/2013 02:29, bill lam wrote: >>> No idea how to read/write a range of cells. You may get some >>> advices in openoffice programmning forums. >>> >>> Вт, 09 июл 2013, Mike Day писал(а): >>>> Having started this thread, which has growed like Topsy, I ought to >>>> report some "progress". >>>> >>>> I think my remarks about 64 and/or 32 bits were misleading. I'd >>>> misunderstood how different Open Office and Office 20xx are under the >>>> bonnet (hood). >>>> >>>> So I've managed to rejig my code so that it more properly recognises >>>> that it needs to output using wdoo rather than tara. >>>> It still reads in what it needs to with readexcel ! The s/sheet is >>>> now getting overwritten in a named worksheet as I wish. >>>> >>>> I wanted to write a boxed numeric array with some nulls but couldn't >>>> see how to do it. I suspect I need GetCellRangeByPosition, but >>>> haven't yet managed to use SetValue without some error. As I avoid >>>> Visual Basic etc like the plague, I don't really want to learn now to >>>> do this. Could wdoo(o) please have some cover functions for moving >>>> arrays in and out? As it is, I'm doing a clunky loop. >>>> >>>> Jbeta really: I haven't yet managed to fully install J801 64-bit - I >>>> want to put it into c:\d\j801* - but install 'qtide' seems not to >>>> download qt.exe - I've spent hours trying to puzzle it out and might >>>> give up choosing where I want it to reside and let the J installer >>>> use the default location. Is qt.exe somewhere in >>>> jsoftware.com/download? >>>> >>>> Mike >>>> * (c:\d is logical drive d: but the os seems not to like d: ! - the >>>> new machine didn't offer a chance to partition the c: drive) >>>> >>>> On 08/07/2013 15:20, David Mitchell wrote: >>>>> Mike, >>>>> >>>>> I tried the demo script oocalc.ijs on both Win7 and Win8 with the >>>>> latest J801. >>>>> >>>>> I found out these things: >>>>> >>>>> 0. Open Office is only available as 32 bit executables. The wdooo >>>>> code will only work with J801 32 bit, as far as I can see. >>>>> >>>>> 1. The verb test.ijs would not work for me on any version of J >>>>> without some changes: >>>>> >>>>> --- >>>>> test=: 3 : 0 >>>>> >>>>> NB. (1!:1 <jpath '~addons/tables/wdooo/test1.ijs') 1!:2 <f=. jpath >>>>> '~temp/test1.xls' >>>>> (1!:1 <jpath '~addons/tables/wdooo/test1.xls') 1!:2 <f=. jpath >>>>> '~temp/test1.xls' >>>>> >>>>> PATH=. '/'&(('\' I.@:= ])}) f >>>>> >>>>> NB. f1=. 'file:///', PATH, '/test1.xls' >>>>> f1=. 'file:///', PATH >>>>> >>>>> smoutput f1 >>>>> --- >>>>> >>>>> I also changed test.ijs to update the second sheet rather than the >>>>> first sheet: >>>>> >>>>> NB. olemethod__p temp ; 'getByIndex' ; 0 >>>>> olemethod__p temp ; 'getByIndex' ; 1 >>>>> >>>>> Once I made these changes, with the latest version of J801 32 bit >>>>> and the current Open Office installed, the workbook test.xls in >>>>> j801-user\temp showed this for Sheet 2 cells D:10, E:10, F:10: >>>>> >>>>> OOo Calc 123 02/28/07 >>>>> >>>>> Which is not in the original workbook. >>>>> >>>>> So the bottom line is that the code example in oocalc.ijs, as >>>>> modified above, will update and save the workbook with one sheet >>>>> modified. >>>>> >>>>> Good luck, >>>>> David Mitchell >>>>> >>>>> >>>>> On 7/5/2013 5:16, Mike Day wrote: >>>>>> (copied to Bill & Ric) >>>>>> >>>>>> I suspect Bill Lam and/or Ric Sherlock are the people are the >>>>>> people to ask >>>>>> here, and but I'll ask the forum as a whole anyway: >>>>>> >>>>>> I've just acquired a new laptop and am enjoying learning 64-bit >>>>>> Windows 8. I'm >>>>>> loth to pay big pounds for Office 2010 or whatever. My 32-bit >>>>>> Windows 7 still >>>>>> supported my old Office 2003 but that doesn't run in Win 8. I've >>>>>> downloaded >>>>>> Open Office which seems to be well thought of as an alternative >>>>>> to M/S Office. >>>>>> >>>>>> I wonder how to continue do the following, which worked under Windows 7 >>>>>> >>>>>> I have a multi-worksheet xls file. >>>>>> My J application successfully reads one small named worksheet, >>>>>> not the first, >>>>>> using readexcel . >>>>>> It uses that information and wished to modify the contents of >>>>>> that worksheet ONLY. >>>>>> Under Windows 7 it successfully called wdoowrite to do this. >>>>>> However, I find the workbook is not updated on the new machine. >>>>>> >>>>>> I had used wdoowrite rather than writexlsheets as it appears that >>>>>> the latter >>>>>> overwrites the whole file, but I might have misunderstood it. >>>>>> It looks as if writeshtdat might do the job, but I'm not sure >>>>>> what locale info >>>>>> to offer as the x argument. >>>>>> >>>>>> Advice would be welcome! >>>>>> >>>>>> Thanks >>>>>> >>>>>> Mike >>>>>> >>>>>> >>>>>> >>>>>> ---------------------------------------------------------------------- >>>>>> For information about J forums see http://www.jsoftware.com/forums.htm >>>>>> >>>>> ---------------------------------------------------------------------- >>>>> For information about J forums see http://www.jsoftware.com/forums.htm >>>>> >> >> > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm