Solved

Data transfering to Excel...

Posted on 1999-01-07
10
223 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

Suggested Solutions

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

685 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