excel from harbour

1,925 views
Skip to first unread message

momo

unread,
Nov 12, 2010, 9:06:37 AM11/12/10
to Harbour Users
Dear friends, I need read a excel file from harbour, can you help me??
TIA
Oscar

Jan Sperling

unread,
Nov 12, 2010, 9:24:44 AM11/12/10
to harbou...@googlegroups.com
Hi Momo:
 
I´m using LIBXL (www.libxl.com).
 
You can read and write XLS files.
Has many features, and  works very well for me.
It's not shareware, you need to buy it.
 
For Harbour, you can access it via DLL or write your own C functions, accesing the LIB.
 
Hope this helps,
 
Jan

Massimo Belgrano

unread,
Nov 12, 2010, 10:55:08 AM11/12/10
to harbou...@googlegroups.com
Hi oscar
 you can using ole in hbwin
please read   C:\harbour\contrib\hbwin\tests\testole.prg 

you can do untested
oExcel := win_oleCREATEOBJECT( "Excel.Application" )
oExcel:Open()
 oAS := oExcel:ActiveSheet()
 ?    oAS:Cells( 1, 1 ):Value 
oExcel:Close()

please post here your final sample


2010/11/12 momo <o...@bvconline.com.ar>

>
> Dear friends, I need read a excel file from harbour, can you help me??
> TIA
> Oscar

--
Massimo Belgrano

Qatan

unread,
Nov 12, 2010, 9:53:56 AM11/12/10
to harbou...@googlegroups.com
Hello Oscar,

Try to compile and execute the testole.prg example that is under
contrib\hbwin\tests folder.
I use it and it works.

Qatan

> --
> You received this message because you are subscribed to the Google
> Groups "Harbour Users" group.
> Unsubscribe: harbour-user...@googlegroups.com
> Web: http://groups.google.com/group/harbour-users

Bopdji Shah

unread,
Nov 12, 2010, 9:32:37 PM11/12/10
to harbou...@googlegroups.com
I have need to use Excel to compose a table which is part English and part Indic language composed using Google tranliteration (IME) facilities.
I now want to bring it under Harbour/xHarbour as a .dbf file as a Unicode file.
What else do I need to do?
Many thanks in advance

Bopdji
Message has been deleted

Karl

unread,
Jan 26, 2014, 5:51:38 AM1/26/14
to harbou...@googlegroups.com
Hi All,

I know it is a old question but it took me a while to figure it out, so the proper syntax may help others in future:

   IF ( oExcel := win_oleCreateObject( "Excel.Application" ) ) != NIL
     oWorkBook := oExcel:WorkBooks:open( "c:/MyProg/foo.xls")
     oAS := oExcel:ActiveSheet()
     ?    oAS:Cells( 1, 1 ):Value 
     oExcel:WorkBooks:Close()
     oExcel:Quit()
   endif

Happy Hacking
 Karl
 
PS: Sorry if there is 2 postings, the close part was still wrong.  Is correct now. 

Qatan

unread,
Jan 26, 2014, 5:58:01 AM1/26/14
to harbou...@googlegroups.com
Hello Karl,
 
Thanks for sharing. It’s always useful.
 
Qatan
 

Dragan Cizmarevic

unread,
Jan 28, 2014, 1:45:27 AM1/28/14
to harbou...@googlegroups.com
This is the actual question, use existing Excel table

Do you have a solution for Open Office Calc table?


Karl

unread,
Jan 28, 2014, 1:54:29 AM1/28/14
to harbou...@googlegroups.com
Hi Dragan,

sorry I don't. As of now the customers have been asking for M$ Excel only. 

Maybe someone else can jump in?

BR
 Karl

Jarosław Kądzioła

unread,
Jan 28, 2014, 2:29:44 AM1/28/14
to harbou...@googlegroups.com
W dniu 2014-01-28 07:45, Dragan Cizmarevic pisze:
> This is the actual question, use existing Excel table
>
> Do you have a solution for Open Office Calc table?
>
see here :

\harbour\contrib\hbwin\tests\testole.prg

--
Regards
Jarosław Kadziola

Nenad Batocanin

unread,
Jan 28, 2014, 1:19:56 PM1/28/14
to harbou...@googlegroups.com

Yes. I made a simple class that supports both Excel and Calc. For instance:

 

oDoc := OLE_Calc ("OO", "test")      // or OLE_Calc ("MS", "test")

x := oDoc:GetCell ("A1")

oDoc:PutCell ("A7", 123)

oDoc:PutCellXY (1, 1, "Some value")

oDoc:CloseTable()

 

regards, NB

--

--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: http://groups.google.com/group/harbour-users
 

---

You received this message because you are subscribed to the Google Groups "Harbour Users" group.

To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

ole.txt

amnaples

unread,
Jan 28, 2014, 1:33:16 PM1/28/14
to harbou...@googlegroups.com
Very good.........but Nenad.ch ??
Rgds
Arcangelo

Nenad Batocanin

unread,
Jan 28, 2014, 1:56:10 PM1/28/14
to harbou...@googlegroups.com

Sorry, here's the correct version.

 

Regards, NB

ole.txt

e.sf

unread,
Mar 25, 2014, 12:22:54 PM3/25/14
to harbou...@googlegroups.com

Hi Nenad,
 
How Do You Get Value Date and Timestamps from oo calc cell
 
.and.
 
if you see my other post, you can add OO methods GetUsedArea and Set/GetDataArray(i,j,x,y) tested ok
In Fact in LibreOffice, not verified in OO
 
 
ESF
Reply all
Reply to author
Forward
0 new messages