Created
June 8, 2017 05:49
-
-
Save TPAKC/41317f35e82fa8464cd942d6a4197b6d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unit Unit2; | |
interface | |
uses | |
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, | |
Dialogs, ExtCtrls, StdCtrls, jpeg, ComObj, Grids; | |
type | |
TForm2 = class(TForm) | |
Image1: TImage; | |
OpenDialog1: TOpenDialog; | |
SaveDialog1: TSaveDialog; | |
Button1: TButton; | |
StringGrid1: TStringGrid; | |
procedure Button1Click(Sender: TObject); | |
private | |
{ Private declarations } | |
public | |
{ Public declarations } | |
end; | |
var | |
Form2: TForm2; | |
implementation | |
{$R *.dfm} | |
procedure TForm2.Button1Click(Sender: TObject); | |
var Excel: variant; i, j: word; | |
begin | |
Excel := CreateOleObject('Excel.Application'); | |
if OpenDialog1.Execute then | |
Excel.Workbooks.Open(OpenDialog1.FileName); | |
for i := 10 to 25 do | |
for j := 1 to 10 do | |
StringGrid1.Cells[j, i-10] := Excel.Sheets[1].Cells[i, j].Text; | |
end; | |
end. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment