Step by step procedure for building Excel client using Developer
Jul 17, 2013 07:04 9 Comments Development wMDevloper

Building an Excel Client For invoking a service:

We can execute wM service from a MS Excel spreadsheet by generating client code .

For to create Excel Client we have ensure about below points:

  • webMethods Integration Server is running.
  • Excel 97 or Excel 2000 is installed.
  • webMethods Type Library is installed.     ( The webMethods Type Library is a COM object that Visual Basic uses to interact with webMethods Integration Server. The webMethods Type Library is automatically installed when you install Developer).

 

 

We have some limitations with Excel client code:

 

  • The client code that Developer generates only supports input values of type String

and output values of type String, String list, and String table.

  • The client code that Developer generates does not support multiple input or output

variables with the same name.

  • When Developer generates client code, Developer replaces any space in a variable

name with an underscore.

If we want to override these limitations, we will need to modify the client code that Developer generates.

 

 

Procedure for Developer generate Excel client code :

 

Use the following procedure to have Developer generate Excel client code that invokes a service.

 

Step 1:  Open the service for which you want to generate client code.

 

alt

 

Step 2 : On the Tools menu, click Generate Code.

 

Step 3 : In the Code Generation dialog box, select For calling this service from a client, and click

              Next.

 

Step 4 : In the Language field, select Excel 97/2000, and click Next.  

 

alt

 

 

Step 5 : Identify the directory where you want Developer to place the generated client code.

             Either select an existing directory or type the path for a new directory. If you type the

             path for a new directory, Developer creates the directory.  

 

alt

Step 6 : Click Finish.

             Developer generates several files(BAS and CLS Files), including the            serviceNameReadMe.txt file. This file contains detailed information about all generated files.  

 

Step 7 : Copy the wmXLTemplate.xls file that Developer provides to the directory that

             contains the client code that Developer generated. The wmXLTemplate.xls file    is located in the Developer_directorysupportExcel directory.

 

alt

 

Step 8 : Open the wmXLTemplate.xls file. When prompted to indicate whether you want to enable macros, select Enable Macros.

 

alt

 

 

Step 9 :  Follow the instructions in the wmXLTemplate.xls file to complete your client

             application. See the ServiceNameReadMe.txt file for information about deploying your  client application.  

 

The files that are Developer generated for an Excel client application:

 

File Name and Description           

 

ServiceNameReadMe.txt A file that contains information and instructions for the Visual Basic client code. Refer to this file for information about deploying your Visual Basic client application.

 

alt

 

ServiceName.bas An example file that illustrates how to use the service class in a spreadsheet. This module is dependent on objects in the project template that Developer provides. It is not intended for use “as is” in custom applications.

 

alt

 

 

ServiceName.cls The service object. You include this object into your own project.

 

alt

 

Instructions in the wmXLTemplate.xls file :

 

  • Make sure you are editing a copy of wmXLTemplate.xls and not the original one.
  • Press Alt-F11 to open Visual Basic for Application.
  • Press Control-M to import a file. Import the generated CLS and BAS files.

 

 

alt

 

  • Enabling Macros

 

alt

 

 

  • Choose Reference from the Tool menu. Scroll down and add “webMethods 6 Type Library”

 

alt

 

 

  • Choose Compile VBA Project from the Debug menu.
  • Return to this page.

 

alt

alt

 

  • Click button “Generate Sheet”.
  • On the new page,type in the input values.
  • Click Invoke.

 

alt

 

  • The result data will appear on the same page.

You can change the inputs and click invokes to run the service again.

 

Prev Next
About the Author
Topic Replies (9)
  1. 1
    idnkx user

    wMDevloper

    Hi Naresh, This error might be occured becuase of your Office installtion you should installed full version of MS office and you must allow system access.

    1
    idnkx user

    wMDevloper

    Hi Mouli, What is the version of Excel? This error message may occurs if you have more than one version of Excel on your system path.Anytime you have multiple versions of Excel, please make sure that the newest version of Excel appears on your system path. Thanks, Renuka

    1
    idnkx user

    Kopparapu Naresh

    in my visual basic ..i am unable to view option -webmethods 6 type library- under tools option. may i know why? have i need to include any thing ??

    1
    idnkx user

    wMDevloper

    Hi Naresh, No need to do any thing for webmethods 6 type library. The webMethods Type Library is automatically installed when you install Developer.The webMethods Type Library is a COM object that Visual Basic uses to interact with webMethods Integration Server. Please check once again tool->references->-webmethods 6 type library- it should be there. Thanks!!

    1
    idnkx user

    wMDevloper

    Hi Mouli, Please chcek once Step 4 : In the Language field, select Excel 97/2000 at the time of generate Excel client code. Thanks, Renuka

    1
    idnkx user

    Kopparapu Naresh

    Hi, I am getting ActiveX component can’t create object error in Excel after clicking the Invoke Button. Can you pls help Thanks, Naresh

    1
    idnkx user

    Monishy

    Hi Renuka, I am getting the below error when i click on execute button, cud you help me to resolve this issue. Error: ======= Automation Error The Specified module could not be found. ======== Thanks, Mouli.

    1
    idnkx user

    Asadul

    I think you have problem while setting up your webMethods 6 type Library option. If not found from Visual Basic for Applications -> Tools -> References tab then Browse and load it from C:SoftwareAGDevelopersupportwin32webMethods.dll

    1
    idnkx user

    Shueb

    i am able to find that webMethods 6 type Library and added that successfully and i don't see any issue while compiling the VB project. when i click on the execute button in the xl sheet it is throwing the mentioned error.

Leave a Reply
Guest User

You might also like

Not sure what course is right for you?

Choose the right course for you.
Get the help of our experts and find a course that best suits your needs.


Let`s Connect