 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Uncle Potato Guest
|
Posted: Fri Aug 05, 2005 9:31 am Post subject: GetOleActiveObject - two Excels running |
|
|
If I have two excel opening two files, how do I know which one I am
getting with GetOleActiveObject ??
|
|
| Back to top |
|
 |
Nikolay Guest
|
Posted: Sun Aug 07, 2005 7:51 am Post subject: Re: GetOleActiveObject - two Excels running |
|
|
Hi this is a big discussion. I will share how I do it with MS WORD and PowerPoint because I am making automation progrmas for Word and PPoint. I think expecially the way I do it with Word will apply to Excel.
1. Just make a template with a startup macro AUTOOPEN or AUTOEXEC or whatever.
2. Make a DELPHI DLL wich will have an exported function that may be called form the startup template.
3. in the automacro autoopen or autoexec call that function with a byval parameter excel.application for example
startin excel.application
you also should declare that as an external function
public declare sub startin lib "mydll.dll" (byval app as application)
4. In the dll you do the following
procedure startin(xl: idispatch);
begin
xapp:=xl as texcelapplication;
end;
You get the texcelapplication class from the server component group of delphi. This method is not that relible because I have
discovered it, meening never read a discription of it, but still
it works and does the job I want.
Nikolay
Uncle Potato <Potato (AT) aelhk (DOT) com> wrote:
| Quote: | If I have two excel opening two files, how do I know which one I am
getting with GetOleActiveObject ??
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|