views:

334

answers:

2

There is a GUI ADM2 Progress v9 application using AppServer.

It needs to give users an ability to view MS Excel files stored on the AppServer. So far it:

  1. Pulls .xls file from AppServer to a local drive.
  2. Fires up a copy of MS Excel and opens the file.

The problem is that the temporary file on the local drive needs to be removed once it's no longer required. Any hints?

A: 

If you are "firing up a copy of Excel", is there any special reason you can't just point that "fired-up" Excel application at the file on your App Server?
If you are starting Excel from a command-line shell, you could just go Excel.exe "http://myserver/myexcelbook.xls" right?

If you are opening it via something like Office Interop Assemblies, then you can key off of the Application.WorkBookBeforeClose event like

ThisMethodHandlesTheWorkbookBeforeCloseEvent()
{
  DeleteTheFile();
}
BKimmel
Unfortunatelly, Progress AppServer does not support http and we don't plan to have a separate web server on the box. Besides the file is confidential and we would need to implement some sort of session/authorisation mechanism.
Firing up the MS Excel via COM is an option, however unless the MS Excel is used as ActiveX I cannot see a way of capturing the workbook before close event (which is really a downside of Progress 4GL).Thank you for ideas!
+1  A: 

You can run Excel using the os-command function in Progress and tell it to wait until you're done viewing to come back to the progress code. Once you're out of Excel run the os-delete command against the file.

Jeremy Edwards