CodedK
asked on
Copy some excell cells to a memo.
Hi.
I dont know how to work with Excell and Delphi so this should be very easy for someone.
Well i'd like to copy certain cells in this order :
L4
H4
D4
L5
H5
D5
L6
H6
D6
L7
H7
D7
....
L804
H804
D804
....
Lx
Hx
Dx
to a memo until there is no data. (numbers) ...Also there are some empty cells.
Thanks in advance.
I dont know how to work with Excell and Delphi so this should be very easy for someone.
Well i'd like to copy certain cells in this order :
L4
H4
D4
L5
H5
D5
L6
H6
D6
L7
H7
D7
....
L804
H804
D804
....
Lx
Hx
Dx
to a memo until there is no data. (numbers) ...Also there are some empty cells.
Thanks in advance.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
The button onclick event in not handled right...
If i place any command before your code ... it does nothing..
procedure TForm1.Button1Click(Sender : TObject);
var ovApp: OleVariant;
ovWB: OleVariant;
ovSheet: OleVariant;
ovValue: OleVariant;
ovRanges: Array [0..2] of OleVariant;
dwRange: Integer;
dwCount: Integer;
dwIndex: Integer;
begin
ShowMessage('Button pressed !!!');
// Create excel application to interact with
ovApp:=CreateOleObject('Ex cel.Applic ation');
...
...
end;
If i place any command before your code ... it does nothing..
procedure TForm1.Button1Click(Sender
var ovApp: OleVariant;
ovWB: OleVariant;
ovSheet: OleVariant;
ovValue: OleVariant;
ovRanges: Array [0..2] of OleVariant;
dwRange: Integer;
dwCount: Integer;
dwIndex: Integer;
begin
ShowMessage('Button pressed !!!');
// Create excel application to interact with
ovApp:=CreateOleObject('Ex
...
...
end;
Um, did you bind the button's onlcick event handler to this event? Better yet, just make it a procedure and call the procedure in your code to test
Russell
Russell
ASKER
Sorry Russell, that was stupid.
I've prepared the form with my own procedures and just copy-paste your proc... :)
Thanks, it works fine...
I've prepared the form with my own procedures and just copy-paste your proc... :)
Thanks, it works fine...
ASKER
I'm trying your code here but it doesn work...
Memo stays empty.
Is there something that i should (add / remove) from the uses of from endifs ?
:/