Problem with LoadXL

Learning APL or new to Dyalog? Ask "silly" questions here, without fear...

Problem with LoadXL

Postby REMINGTON30 on Fri Mar 16, 2018 2:50 pm

I have used LoadXL to transfer vectors or matrices of numerical data to Dyalog APL. However, the line of code below produces DOMAIN ERROR. In the actual code, it is displayed on one line. The indicated range on the spreadsheet is all numerical data. The Excel spreadsheet is located but, for some reason, will not transfer to APL. What is wrong?

Scores←LoadXL'F:\My_Documents_Recent_2017Fall\EMEC425_Fall2017\EMEC425_Final_Fall2017APL.xlsx' 'Sheet1' 'F6:I99'

DOMAIN ERROR
LoadXL[43] :Else ⋄ Sheet←Workbook.Sheets[⊂sheet] ⋄ :EndIf

Status
DISP_E_EXCEPTION (DISP_E_BADINDEX)

REMINGTON30
 
Posts: 19
Joined: Fri Aug 11, 2017 2:17 pm

Re: Problem with LoadXL

Postby Vince|Dyalog on Mon Mar 19, 2018 4:21 pm

Hi Remington30,

I think that that error means that Sheet1 is not a valid sheetname.

I can get that error if I give an invalid sheetname.

Please take a look at this sequence:
      Workbook.Sheets[⊂'Sheet1']
DOMAIN ERROR
Workbook.Sheets[⊂'Sheet1']

Workbook.Sheets.Count
2
Workbook.Sheets[1].Name
MainSheet
Workbook.Sheets[2].Name
Printable
Workbook.Sheets[⊂'MainSheet']
#.[OLEClient].[Workbooks].[_Workbook].[Sheets].[_Worksheet]


Regards,

Vince
Vince|Dyalog
 
Posts: 335
Joined: Wed Oct 01, 2008 9:39 am

Re: Problem with LoadXL

Postby REMINGTON30 on Mon Mar 19, 2018 10:05 pm

Vince:

You are correct. The Excel sheet with the data was labeled 'Worksheet'. I changed it to 'Sheet1' and now LoadXL works for the problem.

Thanks for the help.
REMINGTON30
 
Posts: 19
Joined: Fri Aug 11, 2017 2:17 pm


Return to New to Dyalog?

Who is online

Users browsing this forum: No registered users and 1 guest