Solved

Data transfering to Excel...

Posted on 1999-01-07
10
220 Views
Last Modified: 2010-04-04
When I transfer data from Delphi app. to Excel97
with OLE there is OK, but when I try do it
to Excel95, system raise error "Unknown language".
What's wrong? Help me please..
0
Comment
Question by:Edukas
  • 3
  • 3
  • 2
  • +2
10 Comments
 
LVL 8

Expert Comment

by:ZifNab
ID: 1355088
Edukas,

I can think of two problems :

1. Do these two excel versions have the same language? (English, English). If not then you've to change some OLE functions and methods
2. OLE for 97 isn't totally compatible with 95 :

http://www.inprise.com/delphi/papers/microexcel/

(This paper was written against Delphi 3.01 and Microsoft Office 97. Portions of the paper would also work with Office 95, but the sections on interfaces, in particular, require that you use Office 97.)

Regards, Zif.
0
 
LVL 44

Expert Comment

by:bruintje
ID: 1355089
Hi Edukas,

This is a question that keeps coming back, MS did a great job by getting the Office 97 apps using much of the same VBA or VBA script language. But as Ziff stated OLE for 97 is different from OLE used in 95 because MS had us to use different flavors of basic for every Office app in 95.
So if you want to use OLE with 95 you have to use the VBA in the language in which it is installed. And look up the commands in the help file.

Hope this helps
:O)
Bruintje.
0
 
LVL 2

Expert Comment

by:shogi
ID: 1355090
Hi

  The Excel 97 hierarchie it's not the same that Excel 95.  So you need DLL for each.  So on your development station you will need to install both Excel.  After you just have to create your object for each one.

Regards,
Shogi
0
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 

Author Comment

by:Edukas
ID: 1355091
I use simple code:

procedure TfrmITSaras.ExportToXLS;
var XLS: variant;
begin
  XLS:=CreateOLEObject('Excel.Application');
  XLS.Visible:=True;
  XLS.WorkBooks.Add;
  .................. // data transfering code
  XLS.ActiveWorkBook.SaveAs(FileName:='ES');
  XLS.Quit;
  XLS:=UnAssigned;
end;

0
 
LVL 44

Expert Comment

by:bruintje
ID: 1355092
Hi Edukas,

Where does the error occur and what message is given'??
This could clear up some things.
Thanks.

Bruintje.
0
 

Author Comment

by:Edukas
ID: 1355093
I think there are error with national regions
or national language settings in windows system.
On my computer this code works properly,
but when I use app on ohters computers
this message appears (NRS or NLS is equal to me).
I see this error appears usually when
they used Excel95, but some time it happens
on Excel97.
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1355094
Edukas, as previously asked, do these different offices use other languages? If so, that's the problem! for every language you've to use other methods... Like saveAs will only work in English version.
0
 
LVL 1

Accepted Solution

by:
frla0000 earned 100 total points
ID: 1355095
Hi,

I always prefer things done the easy way. Therefore I suggest you to take a look at TAdvExcel at http://www.econos.de/software/borland/aexcel/index.html (freeware) to do it for you. It has saved me a lot of time and it is compatible with MS Excel v 4 and upwards.

Regards, Fredrik.
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1355096
frla0000,

I believe that component works with DDE, not OLE. Besides, it is not freeware for commercial applications!

Zif.
0
 

Author Comment

by:Edukas
ID: 1355097
When I install Office97 SR-2 patch this problem disapear
on Excel97. MS is MS- "Where do you want to go today"® :)
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Delphi cmd execution 6 60
Delphi : could not find program, '...exe' 2 163
creating threads in delphi 1 101
Wincontrol not (correctly) drawn 15 37
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…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

813 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

10 Experts available now in Live!

Get 1:1 Help Now