 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
graham Guest
|
Posted: Wed Jan 12, 2005 9:32 pm Post subject: Hopefully, a simple TOleContainer Question |
|
|
Hi
I'm have an application that starts excel, creates a workbook and then passes data, sets up charts etc.
Instead of having excel running as a separate application, I would like to open it embedded within my application.
Q1 is TOleContainer the best way to do this?
Q2 How do I associate the TExcelApplication Component with the TOleContainer? (I have seen code for opening an .xls file, but nothing for creating a new workbook)
Thanks in advance
Graham.
|
|
| Back to top |
|
 |
Thaddy de Koning Guest
|
Posted: Thu Jan 13, 2005 10:48 pm Post subject: Re: Hopefully, a simple TOleContainer Question |
|
|
graham wrote:
| Quote: | Hi
I'm have an application that starts excel, creates a workbook and then passes data, sets up charts etc.
Instead of having excel running as a separate application, I would like to open it embedded within my application.
Q1 is TOleContainer the best way to do this?
Q2 How do I associate the TExcelApplication Component with the TOleContainer? (I have seen code for opening an .xls file, but nothing for creating a new workbook)
Thanks in advance
Graham.
Simply put: yes, because it takes most of the pain way. here's the simplest: |
Create a form with a olecontainer and a menu, filled with the mdi frame
menu template,
attach this to the 'Open' menu item:
----snip----
procedure TForm1.Open1Click(Sender: TObject);
begin
with TOpendialog.Create(self) do
try;
filter:='excel files|*.xls';
if execute then
Olecontainer1.CreateObjectFromFile(Filename, false);
finally
free;
end;
end;
---end snip----
That's all...
|
|
| 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
|
|