?
Solved

How can i embed excel sheet in my form, just like an activex control?

Posted on 2001-08-28
3
Medium Priority
?
1,389 Views
Last Modified: 2012-08-13
Treat excel as ole automation server not favorable for my situation.

One way may be the new OWC(Office Web Component) technology, but it had a lot of limit. For example, only support one sheet.

Any idea?

Thanks.
0
Comment
Question by:HBZhang
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 13

Accepted Solution

by:
Epsylon earned 600 total points
ID: 6431657
Use TOleContainer (System tab in component panel).
0
 

Author Comment

by:HBZhang
ID: 6435064
Choose OleContainer has one question, how can i access excel worksheet directly?

I want provide user a button to autofill excel sheet with some datasets.

For example:
  OleContainer1.CreateObjectFromFile('c:\test.xls',false);
  OleContainer1.DoVerb(ovSHOW);
  App := GetApplication(OleContainer1.OleObject);
  WorkBook := GetWorkBook(App);
  WorkSheet := GetWorkSheet(WorkBook);
  WorkSheet.Range(xxx) := xxx;

How can I do it if use OleContainer?

Thanks.
0
 

Author Comment

by:HBZhang
ID: 6435722
I had get it.

procedure TForm1.Button1Click(Sender: TObject);
var
  xlApp, Sheet: Variant;
begin
  xlApp := OleContainer1.OleObject.Application;
  Sheet := xlApp.WorkBooks[1].WorkSheets[1];
  Sheet.Cells[1, 1] := '1234';
  Sheet.Range['A1:C10'].Font.Bold := True;
end;

Thanks, Epsylon.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question