Solved

Data transfering to Excel...

Posted on 1999-01-07
10
222 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
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

860 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