Live integration between APL ARRAY and EXCEL Sheet

APL-related discussions - a stream of APL consciousness.
Not sure where to start a discussion ? Here's the place to be
Forum rules
This forum is for discussing APL-related issues. If you think that the subject is off-topic, then the Chat forum is probably a better place for your thoughts !

Re: Live integration between APL ARRAY and EXCEL Sheet

Postby Morten|Dyalog on Tue Mar 24, 2020 8:04 am

Hi Charles! Could you be falling prey to the same problem that Woodley had - of a non-default value for ⎕WX? The value should be 3. Without this, you need to treat Range as a function rather than an indexable property, and write:

Code: Select all
range←XL.ActiveSheet.Range 'A1:D3'


The ⎕NC-vs-⎕NL behaviour is related to the fact that Dyalog APL wraps all external objects in a "regular" APL namespace. You can inject your own names into this wrapper, and then ⎕NC will report them - but it will only see the "normal" APL names:

Code: Select all
      'XL' ⎕WC 'OLECLient' 'Excel.Application' ⍝ Create a an OLE Client
      XL.XYZ←1234
      XL.⎕NL 2
XYZ
      XL.⎕NC 'XYZ'
2

The negative argument to ⎕NL alters the behaviour in two ways: You get a vector of vectors back, AND it also includes names exposed by the underlying external object (not you ALSO see XYZ in the result):

Code: Select all
      ¯6↑XL.⎕NL -2
 WindowsForPens  Workbooks  WorksheetFunction  Worksheets  XYZ  _Default


If you provide ⎕NC with a nested right argument, you will see the names exposed by the underlying object, and also get a more granular result with sub-classification of the names:

Code: Select all
      XL.⎕NC 'CentimetersToPoints' 'ActiveSheet'
¯3.6 ¯2.6


More about this in the help for ⎕NC and ⎕NL.
User avatar
Morten|Dyalog
 
Posts: 366
Joined: Tue Sep 09, 2008 3:52 pm

Re: Live integration between APL ARRAY and EXCEL Sheet

Postby Charles Brenner on Mon Mar 30, 2020 4:51 am

Hi Morton,
Thanks. I thought I'd checked ⎕WX←3 but since I'm now successful with SaveXL I must've thought wrong.

But the Excel object isn't visible to me. I see a slew of names & functions in Workbook but nothing tempting hits my eye. Can you tell me where to look?

Thanks,
Charles
Charles Brenner
 
Posts: 2
Joined: Mon Mar 23, 2020 4:09 am

Re: Live integration between APL ARRAY and EXCEL Sheet

Postby Morten|Dyalog on Mon Mar 30, 2020 7:54 am

Try (XL.Visible←1) to make Excel show itself?
User avatar
Morten|Dyalog
 
Posts: 366
Joined: Tue Sep 09, 2008 3:52 pm

Previous

Return to APL Chat

Who is online

Users browsing this forum: No registered users and 1 guest