Main Board > Nomads
Displaying an Excel spreadsheet on a NOMADS panel
(1/1)
RobL:
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:
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
RobL:
Hi Stéphane,
Thank you for the reply! You've given me somewhere new to start looking/Googling.
Regards,
Rob
Navigation
[0] Message Index
Go to full version