Solved

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

Posted on 2001-08-28
3
1,373 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
  • 2
3 Comments
 
LVL 13

Accepted Solution

by:
Epsylon earned 200 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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

744 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now