Excel as a Client to Natural via EntireX?

Hi All.

I’ve been tasked to find out how to use Excell as a client to get/send data to Natural via EntireX.

Basically we have a student system running on Nat/Ada and a bunch of lecturers who like using Excel to manipulate results etc. Now the results are stored in Adabas.

So they want an Excel page with a button “Get Results”, then manipulate the data in excell and then click on “Send Results” to update the records on Nat/Ada.

I can write java code to get and send the data, but I’m not too sure how to plug it into excell.

Any ideas/examples/wild musings would be greatly appreciated.

Regards

I can’t help you with using Java from Excel. But, you can use Visual Basic or VBScript easily from Excel and call EntireX.

I would agree with Wayne. You can use the Broker ActiveX control to do COM ACI calls or use the ActiveX/COM RPC Wrapper to call an RPC server such as Natural RPC Server.

You can use VBA (Visual Basic for Applications) from Excel (or Word) to have the Excel code embedded in the Excel spreadsheet.

Doug,
Thanks for getting the terminology correct. I mistakenly wrote VBScript when I should have said VBA (Visual Basic for Applications).

Elmar,
You don’t have to actually “run” Excel. You can write a regular Visual Basic application to create an instance of Excel (this is really running Excel but you do this transparently), open the worksheet, read the data, and send it to NATURAL via EntireX. You need to be familiar with the object model that Excel exposes to VB and other COM applications.

Wayne

Thanks guys, will present your recomendations to our R&D manager.

We don’t have many (actually ANY) VB skills here, we are a Natural environment with some Oracle stuff and lately some Java.

Thanks for all your assistance

Regards

Elmar

Hi Elmar,

attached you will find two code examples. The first one called Customer.xls is a simple VBA example. To view the code select “Tools” → “Macro” → “Visual Basic Editor”.

This example uses a DCOM object generated by the DCOM Wrapper. You will see a GetCustomer(), which is used to do the RPC call and populate the spreadsheet cells, with Account no, name and initials.

The second example called WebVideo.xls uses the ActiveX object. This example if a bit more complex and uses the approach outlined by Douglas.

Hope this will help.

Regards
Theo
VBA.zip (28 KB)

Hi All.

Just wanted to give you guys feedback as to our solution.

I’ve decided to split the process up into two fases.

First fase is to get the data from Natural into Excell: Quite easily done with a jsp type excel page. The users can then save it as an .xls page and fiddle till they are happy with the data.

Second fase: Load the data back into Natural/Adabas: Found an UploadBean thingy on the web, so I use that to load the .CSV file that the users saved their data as (in a spesified format), read the file and send it to Natural record by records and update the data on Adabas. Crude, but it seems to work.

Thanks for all your inputs.

Regards