comp.lang.ada
 help / color / mirror / Atom feed
* GNATCOM interface with MS Excel, Word
@ 2005-06-19  8:01 Rebecca & Firinde
  2005-06-19 14:08 ` Stephen Leake
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Rebecca & Firinde @ 2005-06-19  8:01 UTC (permalink / raw)


Hi,

Can someone give a written and concrete example of using GNATCOM to access 
MS Word or Excel.

Thanks. 





^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: GNATCOM interface with MS Excel, Word
  2005-06-19  8:01 GNATCOM interface with MS Excel, Word Rebecca & Firinde
@ 2005-06-19 14:08 ` Stephen Leake
  2005-06-19 19:16   ` tmoran
  2005-06-21  6:17 ` Frank Piron
  2005-07-08  1:55 ` bubble
  2 siblings, 1 reply; 7+ messages in thread
From: Stephen Leake @ 2005-06-19 14:08 UTC (permalink / raw)
  To: Rebecca & Firinde; +Cc: comp.lang.ada

"Rebecca & Firinde" <fteylouni@mydiax.ch> writes:

> Hi,
>
> Can someone give a written and concrete example of using GNATCOM to access 
> MS Word or Excel.

A better place to ask for this is on the GNAVI list
(http://sourceforge.net/projects/gnavi/) that is the mailing list for
GNATCOM.

-- 
-- Stephe




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: GNATCOM interface with MS Excel, Word
  2005-06-19 14:08 ` Stephen Leake
@ 2005-06-19 19:16   ` tmoran
  2005-06-19 20:17     ` Jeff Creem
  0 siblings, 1 reply; 7+ messages in thread
From: tmoran @ 2005-06-19 19:16 UTC (permalink / raw)


> > Can someone give a written and concrete example of using GNATCOM to access
> > MS Word or Excel.
> A better place to ask for this is on the GNAVI list
> (http://sourceforge.net/projects/gnavi/) that is the mailing list for
> GNATCOM.
   I downloaded gnatcom 1.4, installed it, and ran bindcom excel.exe
without success.



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: GNATCOM interface with MS Excel, Word
  2005-06-19 19:16   ` tmoran
@ 2005-06-19 20:17     ` Jeff Creem
  2005-06-19 22:36       ` tmoran
  0 siblings, 1 reply; 7+ messages in thread
From: Jeff Creem @ 2005-06-19 20:17 UTC (permalink / raw)


tmoran@acm.org wrote:
>>>Can someone give a written and concrete example of using GNATCOM to access
>>>MS Word or Excel.
>>
>>A better place to ask for this is on the GNAVI list
>>(http://sourceforge.net/projects/gnavi/) that is the mailing list for
>>GNATCOM.
> 
>    I downloaded gnatcom 1.4, installed it, and ran bindcom excel.exe
> without success.

Hmm..

I did the same thing and it at least appears to have worked. I ended up
with about 600 packages that appear to be a complete binding to excel.

GNATCOM 1.4 (removed the -gnatg switch that prevents it from building 
with any modern GCC version)

Mingw 4.1 (includes a version based on gcc 3.4.2)

Using Microsoft Excel 2002 10.6501.6714 SP3


In what way did it fail for you?



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: GNATCOM interface with MS Excel, Word
  2005-06-19 20:17     ` Jeff Creem
@ 2005-06-19 22:36       ` tmoran
  0 siblings, 0 replies; 7+ messages in thread
From: tmoran @ 2005-06-19 22:36 UTC (permalink / raw)


> >    I downloaded gnatcom 1.4, installed it, and ran bindcom excel.exe
> > without success.

> I did the same thing and it at least appears to have worked. I ended up
> with about 600 packages that appear to be a complete binding to excel.

> Using Microsoft Excel 2002 10.6501.6714 SP3

> In what way did it fail for you?

GNATCOM.ERRORS.COM_ERROR
HRESULT (2147654730) : Error loading type library/DLL.

Excel About says Excel 2000 (9.0.4402 SR-1)
The excel.exe in question is 7,159,853 bytes dated 7/22/2001 22:44:10



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: GNATCOM interface with MS Excel, Word
  2005-06-19  8:01 GNATCOM interface with MS Excel, Word Rebecca & Firinde
  2005-06-19 14:08 ` Stephen Leake
@ 2005-06-21  6:17 ` Frank Piron
  2005-07-08  1:55 ` bubble
  2 siblings, 0 replies; 7+ messages in thread
From: Frank Piron @ 2005-06-21  6:17 UTC (permalink / raw)


Am Sun, 19 Jun 2005 10:01:38 +0200 schrieb Rebecca & Firinde 
<fteylouni@mydiax.ch>:

> Hi,
>
> Can someone give a written and concrete example of using GNATCOM to 
> access
> MS Word or Excel.

I wrote a small package for winword and a test client too. This is based 
on the packages which you get by running bindcom on MSWORD.olb.



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: GNATCOM interface with MS Excel, Word
  2005-06-19  8:01 GNATCOM interface with MS Excel, Word Rebecca & Firinde
  2005-06-19 14:08 ` Stephen Leake
  2005-06-21  6:17 ` Frank Piron
@ 2005-07-08  1:55 ` bubble
  2 siblings, 0 replies; 7+ messages in thread
From: bubble @ 2005-07-08  1:55 UTC (permalink / raw)


hi Rebecca:
this is sample code , I have test it in Offce 2003
I got only problem is the 3rd parameter in create method.
the default gnatcom for the 3rd is CLSCTX_ALL,
in most case,it work fine but in excel ,you must change 3rd parameter to 
CLSCTX_LOCAL_SERVER.
DO NOT USE GANTCOM 's DEFAULT VALUE





with Excel11.Workbooks_Interface;
with Excel11.uWorkbook_interface;
with Excel11.Application_Interface;
with Excel11.uApplication_Interface;
with Excel11.Sheets_Interface;



with Gnatcom.Initialize;
with Gnatcom.types;
with gnatcom.variant;

with gnatcom.dispinterface;

with Interfaces.C;
use Interfaces.C;

procedure TestExcel is

   app : Excel11.uApplication_Interface.uApplication_Type;
   wbs : Excel11.Workbooks_Interface.Workbooks_Type;
   wb :  Excel11.uWorkbook_interface.uWorkBook_type;
   sheets:Excel11.Sheets_Interface.Sheets_Type;
   sheet:gnatcom.dispinterface.dispinterface_type;
   cellRange:gnatcom.dispinterface.dispinterface_type;


   use Excel11;
   use gnatcom.types;
   use gnatcom;
begin
   Gnatcom.Initialize.Initialize_COM;

   uApplication_Interface.create(
               app,
               "Excel.Application",
               CLSCTX_LOCAL_SERVER);


   uApplication_Interface.Put_Visible(
                app,
                0,
                VARIANT_BOOL_TRUE);

   Workbooks_Interface.Attach(
               wbs,
               uApplication_Interface.Get_Workbooks(app)
               );

   uWorkbook_interface.Attach(wb,
                 Workbooks_Interface.Add(this=>wbs,
                             lcid=>0)
                );

   Sheets_Interface.Attach(sheets,
               uWorkbook_interface.Get_Worksheets(this=>wb)
               );

   dispinterface.Attach(
             sheet,
             Sheets_Interface.Add(this=>sheets,lcid=>0)
             );

  declare
   retValue:gnatcom.types.variant;
   a1:dispinterface.Parameter_Array:= (
                  1=> gnatcom.variant.To_Variant("A1")
                  );
  begin
   retValue :=dispinterface.Get(sheet,"Range",a1);
   dispinterface.attach(
             cellrange,
             gnatcom.variant.To_Pointer_To_IDispatch(retValue)
             );
  end;

  dispinterface.put(
           cellrange,
           "value",
           gnatcom.variant.To_VARIANT("ada call excel")
           );
 Gnatcom.Initialize.uninitialize_COM;

end testExcel;





^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2005-07-08  1:55 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-06-19  8:01 GNATCOM interface with MS Excel, Word Rebecca & Firinde
2005-06-19 14:08 ` Stephen Leake
2005-06-19 19:16   ` tmoran
2005-06-19 20:17     ` Jeff Creem
2005-06-19 22:36       ` tmoran
2005-06-21  6:17 ` Frank Piron
2005-07-08  1:55 ` bubble

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox