Delphi Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - MoreDelphi Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 10th, 2012, 12:14 AM
icuras icuras is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2007
Posts: 165 icuras User rank is Sergeant Major (2000 - 5000 Reputation Level)icuras User rank is Sergeant Major (2000 - 5000 Reputation Level)icuras User rank is Sergeant Major (2000 - 5000 Reputation Level)icuras User rank is Sergeant Major (2000 - 5000 Reputation Level)icuras User rank is Sergeant Major (2000 - 5000 Reputation Level)icuras User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Day 4 h 42 m 59 sec
Reputation Power: 36
Copy Excel into delphi

I want to know if it is possible to copy an excel spreadsheet into delphi.

What i want to do is to copy the sheet into the WINDOWS CLIPBOARD then somehow control it in my program. Is there a way of doing it?

Many thanks in advanced!

Reply With Quote
  #2  
Old February 10th, 2012, 12:39 PM
Dimixx Dimixx is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2010
Posts: 68 Dimixx User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 23 h 53 m 47 sec
Reputation Power: 4
Hi
you can read here Basic Clipboard Operations (Cut/Copy/Paste) using the TClipboard object. You don't mention how you want to present the information from the clip board in your program. If I have to guess you may want to add it in a grid. So you can load your clipboard in TStrings varaible or a TStringList and then manually add it in a ClientDataSet.

Dimiter

Reply With Quote
  #3  
Old February 11th, 2012, 01:35 PM
majlumbo majlumbo is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2008
Posts: 255 majlumbo User rank is Lance Corporal (50 - 100 Reputation Level)majlumbo User rank is Lance Corporal (50 - 100 Reputation Level)majlumbo User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 3 Days 2 m 4 sec
Reputation Power: 5
You may want to look towards automating excel through OLE automation, rather than using the clipboard. Taking control of a user's clipboard is less than an optimal method.

By inserting something into the clipboard, you'd also be wiping out what may have been put there by a user, and they'd be left wondering what happened.

There's lots of good articles on automating excel from Delphi, here's one: http://edn.embarcadero.com/article/10126
Comments on this post
Dimixx agrees!

Reply With Quote
  #4  
Old September 4th, 2012, 04:49 AM
autopost autopost is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2012
Posts: 1 autopost User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 8 m 28 sec
Reputation Power: 0
good ......

Reply With Quote
  #5  
Old September 30th, 2012, 10:37 AM
MikalThor MikalThor is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2012
Posts: 3 MikalThor User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 59 m 17 sec
Reputation Power: 0
EOleSysError in Windows 7

I'm using Delphi 4 and in trying to open Excel through my Delphi program in Windows 7, I get an exception as the program is starting... "Exception EOleSysError in module MYPROGRAM.EXE at 000979C5, Class not registered." The code works just fine in an XP environment.

Reply With Quote
  #6  
Old December 18th, 2012, 03:47 AM
icuras icuras is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2007
Posts: 165 icuras User rank is Sergeant Major (2000 - 5000 Reputation Level)icuras User rank is Sergeant Major (2000 - 5000 Reputation Level)icuras User rank is Sergeant Major (2000 - 5000 Reputation Level)icuras User rank is Sergeant Major (2000 - 5000 Reputation Level)icuras User rank is Sergeant Major (2000 - 5000 Reputation Level)icuras User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Day 4 h 42 m 59 sec
Reputation Power: 36
Re

VAR
S, T, U, V:STRING;
vTemp:string;
newpos:integer;
begin

S := Clipboard.AsText;

while s <> '' do
begin
t := copy(s, 1, pos(#9, s) - 1);
//to get the columns, parse "t"
ShowMessage(T);

vTemp := Copy(S, pos(#9, S) + 1, Length(S));
u := copy(vTemp, 1, pos(#9, vTemp) - 1);
ShowMessage(u);

vTemp := Copy(u, pos(#9, u) + 1, Length(u));
v := vtemp;
ShowMessage(v);
end;


i am trying to get each character that i have in excel..my excel file looks like this

1,2,3
4,5,6
7,8,9

Is there a beter way. I just dont get what i want. Ideally i want "1", "2", "3" first line add it to a database then go the 2nd line "4", "5", "6". *without quotes.

Any ideas?

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreDelphi Programming > Copy Excel into delphi

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap