PxPlus User Forum

Twitter Twitter Twitter

Author Topic: Displaying an Excel spreadsheet on a NOMADS panel  (Read 986 times)

RobL

  • Silver Member
  • ***
  • Posts: 21
    • View Profile
Displaying an Excel spreadsheet on a NOMADS panel
« on: June 04, 2021, 07:55:23 PM »
Hi All,

I'm trying to display an Excel spreadsheet within a COM control defined on a NOMADS panel. I have the COM Control defined as "Excel.Application". In the "PostCreate" logic contains the following code:

filename$=pth("2013-09-30.xlsx")
com_1.ctl'Workbooks'Open(filename$)
com_1.ctl'Visible=1


When I test the panel, Excel starts in a window behind the NOMADS panel and loads the specified file. I've also tried something similar outside of NOMADS, with the same result; Excel opens in a separate window.

begin
def object xl,@(2,2,60,40)="Excel.Application"
xl'Workbooks'Open(pth("2013-09-30.xlsx"))
xl'Visible=1
xl'Quit()


I found some code in my Mailing List archive that works using "Shell.Explorer" and PDF files, and optimistically hoped it would work in a similar fashion with Excel.

Is it possible to do this? Any nudges in the right direction would be greatly appreciated!!

Regards,

Rob Leighton
Riverwood Enterprises Inc.

Stéphane Devouard

  • Diamond Member
  • *****
  • Posts: 122
  • PxPlus guru with skills in PHP, JS, C#, Java
    • View Profile
    • Stéphane's Web Resume
Re: Displaying an Excel spreadsheet on a NOMADS panel
« Reply #1 on: June 06, 2021, 05:52:07 AM »
Rob


When you use the "Excel.Application" ProgID, you create as the name implies, an Excel application object
That is, you ask for an EXCEL.EXE executable to run, with its own user interface, that you can make visible with the 'Visible property


If you want to embed an Excel object on a panel of yours, you need to use either the "Excel.Addin" ProgID for a workbook, or "Excel.Sheet" for a simple worksheet


However, I haven't found any Load(), Open() or similar method to load data from an existing .xlsx file


Maybe others who have been more successful can chime in


Hope this helps


Regards
Stéphane Devouard
Portfolio | Work

RobL

  • Silver Member
  • ***
  • Posts: 21
    • View Profile
Re: Displaying an Excel spreadsheet on a NOMADS panel
« Reply #2 on: June 06, 2021, 03:22:59 PM »
Hi Stéphane,

Thank you for the reply! You've given me somewhere new to start looking/Googling.

Regards,

Rob
« Last Edit: June 06, 2021, 05:59:01 PM by RobL »