Link to home
Start Free TrialLog in
Avatar of CodedK
CodedKFlag for Greece

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.
ASKER CERTIFIED SOLUTION
Avatar of Russell Libby
Russell Libby
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of CodedK

ASKER

Hi Russell, thanks for your help...
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 ?

:/
Avatar of CodedK

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('Excel.Application');
...
...
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
Avatar of CodedK

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...