Oh - I see I've already done that.  Look at "addWS" in OLEExcel.ijs which is
as follows:

NB.* addWS: add named worksheet to spreadsheet file.
addWS=: 3 : 0
  'flnm wsnm'=. y.
  xlopen ''
  xlcmd 'wb open ',flnm
  xlid 'ws' [ xlget 'temp worksheets'
  xlcmd 'ws add'
  xlset 'temp name ',wsnm
  xlexit ''
)



On 3/13/07, Devon McCormick <[EMAIL PROTECTED]> wrote:

Leigh -

you can do this using OLE:

   xlopen ''
   xlcmd 'wb open ',wbn=. quoteIfSp STARTLOC,NEWTEAMSFILE
   bn=. xlget 'temp name' [ xlget 'base activeworkbook'
   xlid 'ws' [ xlget 'temp worksheets'
   xlcmd 'ws add'
   xlset 'temp name stats'

where "quoteIfSp" puts double quotes around the name if it has embedded
spaces;
The variable "bn" is the base name of the sheet to be used in subsequent
writes, etc.

Maybe I should add a "createNewWorksheet" function to my OLEExcel package
at http://www.jsoftware.com/jwiki/Scripts/OLEExcel ?

Hope this helps.

Devon


On 3/13/07, bill lam < [EMAIL PROTECTED]> wrote:
>
> No, you can't. AFAIK Excel only provides oleautomation for programming
> interface.  You may read the entire workbook and recreate it together
> with new
> worksheets yourself.
>
> Leigh J. Halliwell wrote:
> > Dear J Forum:
> > I'm designing a J application that reads data from an Excel workbook
> and an
> > produces several array results.  I would like to return each array as
> a new
> > worksheet in that workbook, and save the augmented workbook.  The
> "Tara and
> > Excel" lab shows only how to create new workbooks, not how to add
> sheets to
> > existing ones.  How can I do the latter?  Or should I use something
> other
> > than the Tara package?  My knowledge of OOP is rudimentary (I learn as
> I
> > go), so please try to keep things simple.  Thanks.
> > Sincerely,
> > Leigh
> > Leigh Joseph Halliwell, FCAS, MAAA
> > Chief Manager
> > L. J. Halliwell, LLC
> > 406 Gibson Pond Rd
> > Chattanooga, TN  37421-5368
> > 423-296-2739
> > 423-605-5789 cell
> > 423-954-2772 fax
> >  <mailto:[EMAIL PROTECTED]> [EMAIL PROTECTED]
> >  <http://www.lhalliwell.com/> www.lhalliwell.com
> > This communication is intended solely for the use of the individual to
> whom
> > or the entity to which it is addressed. It may contain information
> that is
> > privileged, confidential, and exempt from disclosure under applicable
> law.
> > If you are neither the intended recipient, nor the employee, nor the
> agent
> > responsible for delivering the communication to the intended
> recipient, you
> > are hereby notified that any dissemination, distribution, or copying
> of this
> > communication is strictly prohibited. If you have received this
> > communication in error, please notify us immediately by telephone or
> email,
> > delete the communication from any computer or other electronic storage
> > media, and destroy all other copies in your possession.
> >
> >
> >
> >
> ------------------------------------------------------------------------
> >
> > ----------------------------------------------------------------------
> > For information about J forums see http://www.jsoftware.com/forums.htm
>
>
> --
> regards,
> bill
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>



--
Devon McCormick, CFA
^me^ at acm.
org is my
preferred e-mail




--
Devon McCormick, CFA
^me^ at acm.
org is my
preferred e-mail
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to