Solved

Data transfering to Excel...

Posted on 1999-01-07
10
216 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
 

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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

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…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

743 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

12 Experts available now in Live!

Get 1:1 Help Now