TestExcel program

I tried using your TestExcel program to read a cell. I set the file name with           

move spaces to ExcelFileName
           string 'z"C:\Users\alan\Documents\Micro Focus\'
             'Net Express 5.1\WORKAREA\SMNG\emailsmar25.xlsx"'
             delimited by size into ExcelFileName
This is in the NE5.1 IDE with Wrappack 18 on Windows 10.  Error: Open methods of Workbooks class failed on "Open"

The path C:\Users\alan\Documents\Micro Focus\Net Express 5.1\WORKAREA\SMNG is correct.

The file name is emailsmar25.xlxs

I do not understand what is wrong.  I examined the ExcelFileName while animating and it is correct.

Thank you,

Alan Beecher

Parents Reply Children
  • I think see the problem now. Since you are using string, your null termination will be after the first literal and not at the end of the filename as required.

    Try this instead:

     string 'C:\Users\alan\Documents\Micro Focus\'
                 z'Net Express 5.1\WORKAREA\SMNG\emailsmar25.xlsx'

    Chris Glazier
    Rocket Software - Principal Technical Support Specialist
    If you found this post useful, give it a “Like” or click on "Verify Answer" under the "More" button

  • I switched to using a simpler PATH and the program run perfectly.  Just C:\WRK\emailsmar25.xlsx.

    So the problem was definitely with the path.  I am not familiar with "z". 
    I just found this in Help - In addition, a nonnumeric literal can be null-terminated (i.e. have a null byte x"00" at the end of the literal) by expressing it as: Z"string", where string is a non-numeric literal. 

    So it would also be correct to STRING "C:\Wrk\emailsmar25.xlsx" 'x"00"' delimited by size into FileName

    Thank you for teaching  me.

    Alan Beecher