Excel- Saving File name in Delphi

Giganews Newsgroups
Subject:Excel- Saving File name in Delphi
Posted by: Terry Black
Date:Sun, 5 Oct 2008

Hi, I had an earlier problem (see Word - Saving file name in Delphi). This was solved by *Deborah Pate (TeamB)* who provided an excellent solution as follows (The TWordApplication component has an event,
OnDocumentBeforeSave, which would alert you to the document's being saved, but unfortunately the rename hasn't occurred at this point so you can't get the name directly there. However
you could check the document's name a few seconds later on a timer (and use the OnDocumentBeforeClose event to make sure ,you don't miss it).

However, I now want to do exactly the same thing in Excel but I find that the TExcelApplication component's events don't work.

So just to clarify what I want to do. I am using Delphi7 and using Shellexec to run ExcelXP. When I run Excel from within Delphi I want to be able to capture the name (and path) of the file that Excel has saved. Until the user saves in Excel I will not be able to determine the files name.

Thanks

Terry

Replies