Reliability of Forte's OLE Automation Server

Hi Forte Users,
We are currently working on the feasibility of developing OLE interface
for our existing Forte services. In that process we are wondering about the
reliability these Forte OLE servers as compared to any other normal Forte
Servers. Has anyone have any experience of using them or any ideas about the
thing we need to concentrate before starting the development of these
servers.
Any input on this issue will be appreciated.
Thanks in advance,
Charu.
To unsubscribe, email '[email protected]' with
'unsubscribe forte-users' as the body of the message.
Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

A point worth mentioning here is about fail-over of service objects
that are configured as OLE automation servers.
If you are using Forte clients to talk to the service object,
then you really will not see any changes in automatic failover
situations.
However, in case of a non-Forte client( a.k.a. OLE client ), the
automatic failover does not happen. The non-Forte clients should be
coded to detect communication failures with the primary server. They
should have the intelligence to re-connect and retry methods on the (
new ) OLE server. This means you will have to program fail-over logic in
non-Forte clients, which you get for free with Forte clients.
I am not sure what kind of requirements is driving your process of
converting Forte services to OLE servers, but it is worth deliberating
on this problem, if you are not planning to use non-Forte clients, but
want to implement the services as OLE automation server.
Ofcourse you don't have to worry about this issue if you are not
planning to use non-Forte clients...
Good luck
Ajith Kallambella M.
Forte Consultant.
Please respond to Shi-Long Yin <[email protected]>
Subject: Re: Reliability of Forte's OLE Automation Server
Hi,
Essentially, I don't see any big differences between configuring and
exporting
the Forte service objects as normal Forte servers and DCE, Encina,
Tuxedo,
Object Broker, IIOP or OLE servers. We have already succeeded
configuring the
Forte servers as IIOP and OLE servers. Our Visual Basic client can
communicate
with the OLE server. The big difficulties are that there are two
limitations to
what elements of the service object&euro;s class are available to an OLE
client.
First, an OLE client application can access any methods provided by that
service
object&euro;s class, except for methods that use objects as parameters.
Second, OLE
clients can not access attributes of a Forte service object. OLE
clients can
only pass the following objects and data types as parameters and return
values:
TOOL data type Maps to OLE data type
Boolean Boolean
Cdispatch IDispatch
Cunknown IUnknown
Double Double
Float Float
Integer Long
i2 Iteger
string String
ui2 Short
ui4 Long
If a Forte service object includes methods that have object parameters
or return
values other than CUnknown and CDispatch, these methods are not included
as part
of the interface to this OLE server. Compared to the IIOP
configurations, the
limitations listed above may be too strict, especially, when you want to
export
your existing Forte services which may have interfaces with classes as
their
parameters or return types. But for IIOP, you can freely pass class
objects
(even deeply nested and derived) as method&euro;s parameters or return
values. This
feature has significantly saved our development and maintenance time.
Other
alternatives may be to write the wrappers to overcome these limitations.
In one word, if you intend to integrate the EXISTING codes, which have
methods
with class parameters, you'd better to avoid configuring Forte service
objects
as OLE server. Try to use IIOP as much as you can because it is more
OOP
compatible and interoperable.
Shilong Yin
US West in Denver
=====================================================================
Charu wrote:
Hi Forte Users,
We are currently working on the feasibility of developing OLE interface
for our existing Forte services. In that process we are wondering about the
reliability these Forte OLE servers as compared to any other normal Forte
Servers. Has anyone have any experience of using them or any ideas about the
thing we need to concentrate before starting the development of these
servers.
Any input on this issue will be appreciated.
Thanks in advance,
Charu.
To unsubscribe, email '[email protected]' with
'unsubscribe forte-users' as the body of the message.
Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>
To unsubscribe, email '[email protected]' with
'unsubscribe forte-users' as the body of the message.
Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>
Get Your Private, Free Email at http://www.hotmail.com
To unsubscribe, email '[email protected]' with
'unsubscribe forte-users' as the body of the message.
Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

Similar Messages

  • OLE Automation Server

    Hi all.
    I've been asked to help in a project where the main portion of it is
    being written using labview (G), which I'm not familiar with.
    I've had a quick browse through the various labview manuals, and really
    don't want to go off at a tangent from what I need to do, meaning that I
    don't have time to become proficient with labview - the current
    "developer" does not describe himself as a "programmer", which is why he
    chose labview.
    Anyway, the job requires me to interface a Thompson Frame Grabber card
    (FGT) with labview. Thompson supply an SDK and the source for a
    Microsoft Visual Studio sample program. Unfortunately, no source for the
    SDK DLL/driver.
    Reading their French-glish manuals, the way they expect you to control
    the FGT card is via a supplied DLL. They do supply some guidance on how
    to do this, but the problem I have is that the DLL requires various low
    level capabilities to allow things like an overlay window, callbacks,
    etc. Given that such info seems to be rather difficult (tedious) to
    extract or have labview perform, I've decided I should write (using
    Delphi or C++) another component to talk directly to their DLL, and have
    labview control the new component that I write.
    Looking through the various manuals, I see that labview supports
    ActiveX, but I'm unsure wether that is restricted to just ActiveX
    controls specifically, or wether labview can interface with an
    Automation Server (OLE and ActiveX are built upon COM) ?
    If so, how does one "import" the Automation server's interface into the
    labview environment/IDE, so my "non-programmer" client to easily
    interface with an Automation Server ?
    The reason that I want to go with a standalone, out-of-process (OOP...?)
    Automation Server, as opposed to an in-process server, or an ActiveX
    control, is that (naive) attempts thus far with interfacing labview with
    the FGT DLL has lead to serious side effects, such as crashing the
    system. However, trivial trials using Borland C++ Builder to interface
    with the FGT DLL produced none of those stability problems.
    Another reason is that if I make an ActiveX control, the possibility of
    multiple use rears it's head, which the DLL and overlay functions do not
    support, nor make sense for it to.
    I will shortly install a temporary copy labview (5.1 ?) on my Dual boot
    Win98/Win NT4 system here, just to experiment with labview. But my
    client is using NT4 SP6, with a dual processor Xeon system (although
    we've removed one of the CPU's due to various weirdities with labview).
    Any additional pointers or confirmations would be most helpful.
    //)) //))| Richard RUDEK. MicroDek. Chatswood, Sydney. Australia. |
    //\\ //\\ |http://microdek.homepage.com/ |
    |________________________________________________________|

    > Reading their French-glish manuals, the way they expect you to control
    > the FGT card is via a supplied DLL. They do supply some guidance on how
    > to do this, but the problem I have is that the DLL requires various low
    > level capabilities to allow things like an overlay window, callbacks,
    > etc. Given that such info seems to be rather difficult (tedious) to
    > extract or have labview perform, I've decided I should write (using
    > Delphi or C++) another component to talk directly to their DLL, and have
    > labview control the new component that I write.
    >
    > Looking through the various manuals, I see that labview supports
    > ActiveX, but I'm unsure wether that is restricted to just ActiveX
    > controls specifically, or wether labview can interface with an
    > Automation Server (OLE and ActiveX are built upon COM) ?
    >
    > If so, how does one "import" the Automation server's interface into the
    > labview environment/IDE, so my "non-programmer" client to easily
    > interface with an Automation Server ?
    >
    > The reason that I want to go with a standalone, out-of-process (OOP...?)
    > Automation Server, as opposed to an in-process server, or an ActiveX
    > control, is that (naive) attempts thus far with interfacing labview with
    > the FGT DLL has lead to serious side effects, such as crashing the
    > system. However, trivial trials using Borland C++ Builder to interface
    > with the FGT DLL produced none of those stability problems.
    >
    > Another reason is that if I make an ActiveX control, the possibility of
    > multiple use rears it's head, which the DLL and overlay functions do not
    > support, nor make sense for it to.
    >
    > I will shortly install a temporary copy labview (5.1 ?) on my Dual boot
    > Win98/Win NT4 system here, just to experiment with labview. But my
    > client is using NT4 SP6, with a dual processor Xeon system (although
    > we've removed one of the CPU's due to various weirdities with labview).
    >
    If you inflate any arrays or strings before calling the DLL, then
    there shouldn't be any problem calling into the DLL. This is how
    the NI drivers are built. If you would rather, then you can use
    the ActiveX client functions. LV can contain controls, and can
    access any automation server. The function for importing is the
    Automation Open function. Its in the ActiveX palette. Popup on
    it to create an automation refnum, and type it to be the server
    that you are creating and registering.
    As for problems with the Dual processor, I now of a number of
    LV users that use dual processor machines with no problem. If
    you have problems, it is more likely to be a problem with a
    driver. If it is anything reproducable, then please report it
    to NI.
    Greg McKaskle

  • GPF and OLE Automation with Word6

    Has anyone else had a problem with GPFs when trying to use Word6 as an OLE
    Automation Server? Whenever our users try to open Word6 from the
    application they get a GPF in QQKN.DLL at 000C:955C. What does the QQKN.DLL
    do?
    Any ideas?
    - Scott Splavec - MIS 8
    Business Analyst
    Kirke-Van Orsdel, Inc.
    1776 West Lakes Parkway
    West Des Moines, IA 50398
    (515) 248-6472
    eMail: kvi!kvidm01![email protected]

    Hi Aurang
    You can call almost all methods using OLE. What is required is to know how to interpret a script to ABAP OLE call. This is explained in the tutorial<a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/c1d54348-0601-0010-3e98-bd2a2dcd9e6c">"An Easy Reference For OLE Automation"</a>
    Regards
    *--Serdar <a href="https://www.sdn.sap.com:443http://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.sdn.businesscard.sdnbusinesscard?u=qbk%2bsag%2bjiw%3d">[ BC ]</a>

  • Multisim and OLE automation

    Hello, this is my first post. Is it possible to use Multisim as an OLE Automation server? I am also thinking of using MATLAB or VB as the Automation client. if so, is there any documentation available from NI? Thanks.

    Juan,
    It's possible to use Multisim as an Automation API. You will need the Multisim 10.1 to use the new API features available.
    Open the Multisim 10.1 and go to Help >> Multisim Help. Select the Contents Tab and look for the Automaton API Chapter. In there you will find all the information needed.
    Dario Camargo
    NI Brazil
    #1159649

  • Ole Automation with forte.

    Good Day forte users,
    I'm trying to invoke MSWord from a forte application.
    I set the objectreference using CreateUsingProgId(This is the only way
    that I could get it to work).
    The problem is when using CreateUsingProgId, forte will create another
    instance of Word. Is there a way to know if the instance already exists
    and retrieve the objectreference of that instance?
    Any help would be appreciated.
    Thanks
    Quy Tran
    Lumley Technology
    Analyst/Programmer
    [email protected]
    Ph : 612 93186722
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

    Hi!
    I am not sure that I can give you any "golden rules" for interfacing
    with OLE, but I can give you some thoughts on where to look for problems
    that can result in Segmentation Violations.
    I have often seen segmentation violations arise as a result of a NIL
    object. You might want to try turning on the trc:lo:25 trace flag to
    see if there is a NIL object exception being raise right before the seg
    v. You have to be careful with the trc:lo:25 flag, though, since it
    will show you every exception, no matter what, that is raised within
    Forte (even if it's been handled internally). This is of greater
    significance to OLE projects, since Forte tries several different ways
    of starting an OLE server and uses internally handled exceptions to
    notify itself if a certain method failed.
    Another thing to try is just-in-time debugging. You will need Microsoft
    Visual C++ installed on the machine where the OLE code is running, and
    you will need to set the FORTE_NOHANDLER environment variable to TRUE.
    In the MSVC development environment, go to the Tools --> Options
    properties sheet, and choose the Debug tab. On that tab, make sure that
    Just-In-Time Debugging is selected. Then, run the application. When
    you encounter the seg v, you should get a dialog box asking if you want
    to debug the application. Choosing yes (actually, I think that pressing
    Cancel does this - the dialog box tells you) will bring you into the
    MSVC development environment, where you can try some intense debugging.
    I hope this helps!
    -Katie
    [email protected] wrote:
    >
    Has anybody used Forte to communicate with external components using
    OLE
    Automation? We are creating segmentation violations through some of
    our
    use of this interface, and need to know if there are some 'golden
    rules'
    that can guide developers as they use the feature.
    Thank you!--
    Katie Carty
    Forte Consulting
    4801 Woodway Drive
    Suite 300E
    Houston, Texas 77056
    vmail: 510-986-3802
    email: [email protected]
    -----------------------------------------------

  • RE: Ole Automation with forte.

    Tran,
    Here is a piece of code(using Forte Version 3OF2 & Word 97) that we've
    used to determine if there is already an instance of Word running:
    // Create an instance of a Word Application and activate it.
    // If an a Word application exists, just activate it.
    if ( aTasks <> NIL and aTasks.Exists(aWordApplication.Name) )
    then
    aWordApplication.visible = TRUE;
    aWordApplication.Activate();
    else
    aWordApplication = new();
    aTasks = new();
    aWordApplication.CreateUsingProgID( 'word.application'
    aWordApplication.visible = TRUE;
    aWordApplication.Activate();
    aTasks is an attribute of type Tasks on our window & aWordApplication is
    an attribute of type _Application on our window. This code will work if
    there already is an instance of Word that was started from a Forte
    applicaiton. It doesn't recognize a instance of Word that was started
    outside of a Forte app. Hope this helps!!
    From: Quy Tran[SMTP:[email protected]]
    Sent: Wednesday, May 20, 1998 11:17 PM
    To: [email protected]
    Subject: Ole Automation with forte.
    Good Day forte users,
    I'm trying to invoke MSWord from a forte application.
    I set the objectreference using CreateUsingProgId(This is the only way
    that I could get it to work).
    The problem is when using CreateUsingProgId, forte will create another
    instance of Word. Is there a way to know if the instance already
    exists
    and retrieve the objectreference of that instance?
    Any help would be appreciated.
    Thanks
    Quy Tran
    Lumley Technology
    Analyst/Programmer
    [email protected]
    Ph : 612 93186722
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive
    <URL:http://pinehurst.sageit.com/listarchive/>
    If you are not the intended recipient, please notify the Sender.
    Non-business opinions may not reflect opinions of Piper Jaffray

    Hi Aurang
    You can call almost all methods using OLE. What is required is to know how to interpret a script to ABAP OLE call. This is explained in the tutorial<a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/c1d54348-0601-0010-3e98-bd2a2dcd9e6c">"An Easy Reference For OLE Automation"</a>
    Regards
    *--Serdar <a href="https://www.sdn.sap.com:443http://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.sdn.businesscard.sdnbusinesscard?u=qbk%2bsag%2bjiw%3d">[ BC ]</a>

  • Is it possible to create Excel Sheet using OLE automation in App server

    Hi,
       Is it possible to create Excel Sheet using OLE automation in Application server(Open Dataset)
    Thanks in advance...

    Unless your application server is on Windows OS, or it is connected to a Windows server by RFC. What is the requirement exactly, I don't understand?

  • [b]Tutorial:[/b] Simplify Developing OLE Automation Code Using VBA

    INTRODUCTION
    Automating Office applications from Oracle Forms can be a tedious, frustrating, and time-consuming process. Because the OLE2 and CLIENT_OLE2 built-ins do not validate the automation commands that they relay, code that compiles without errors often dies at runtime with a not-so-helpful error code. This tutorial will demonstrate how to simplify the development of automation code using a tool that ships with all Microsoft Office editions -- the Visual Basic for Applications (VBA) IDE.
    The VBA IDE, a core Office component, is a full-fledged development environment featuring code completion, basic syntax highlighting, context-driven help and a runtime debugger. Its Object Browser provides a convenient means of browsing the Word object model, as well as searching by keyword.
    For those who may not interested in following this tutorial in detail, I would like to stress the usefulness of the Object Browser as a tool for inspecting the functions supported by OLE server applications and, perhaps more importantly, valid values for function arguments. Whether/not anyone buys the assertion that starting with VBA prototypes is far more productive than pounding out OLE2 code from the very start, they will find the Object Browser invaluable as a reference -- I rely on it exclusively for this sort of documentation.
    A BRIEF INTRODUCTION TO THE VBA IDE & THE OBJECT BROWSER UTILITY
    Try this:
    1. Open Word
    2. Launch the VBA IDE by pressing <Alt><F11>
    3. Open the Object Browser by pressing <F2>
    The Object Browser allows you to visually navigate Word's class hierarchy. Its user interface is a bit crowded, so controls are unlabeled. Hovering the mouse cursor above a control will display a tooltip explaining that control's purpose. The browser's scope can be narrowed by using the Project/Library combo. Typing a keyword or substring in the Search Text combo and clicking on the Search button will cause all classes/members whose name contains the specified search text to be listed in the Search Results pane. Selecting an item from this list will update the two panes below it, showing the selected class, and its members. Beneath the Classes and Members panes is an untitled pane, gray in color, which displays details for the selected class/member, including hyperlinks to relevant information such as arguments, their types and allowable values. If Visual Basic Help is installed, pressing <F1> will display help on a selected class/member. (This feature can be installed from your Office install CD, if necessary.)
    NOTE: While it is possible to cut-and-paste the code examples that follow, I highly recommend that they be typed in by hand. Doing so will provide a better understanding of how the IDE's code completion behaves. Use code completion most efficiently by not using the mouse or <Enter> key when selecting from completion lists. Instead, just type enough letters to select the desired list element, then continue along as if you had typed the entire element, typing the next operator in your statement. It really is slick!
    HELLO WORLD - VBA-STYLE
    1. Open Word
    2. Launch the VBA IDE by pressing <Alt><F11>
    3. Select Module from the Insert menu.
    4. In the blank area that appears, enter the following code:
      Public Sub HelloWorld()
          Documents.Add
          Selection.TypeText ("Hello, world!")
      End Sub5. Press <F5> to run the code.
    If you switch back to Word by pressing <Alt><F11>, there should appear a newly-created document containing the text Hello, world!.
    A MORE AMBITIOUS EXAMPLE
    In this example, we will launch Word, type some text, and alter its formatting. For the purposes of this tutorial, consider it the process we wish to automate from within Forms.
    1. If Word is running, close it.
    2. Open any Office application except Word, such as Excel, Outlook or PowerPoint
    3. Launch the VBA IDE by pressing <Alt><F11>.
    4. Select References from the Tools menu -- a dialog should pop up.
    5. From within this dialog, locate and select Microsoft Word <version> Object Library, then click OK.
    6. Select Module from the Insert menu.
    7. In the blank area that appears, enter the following code:
    Public Sub LaunchWord()
        Dim app As Word.Application
        Set app = CreateObject("Word.Application")
        app.Visible = True                          '!!! IMPORTANT !!!
        app.Documents.Add
        With app.Selection
            .TypeText "This is paragraph 1."
            .TypeParagraph
            .TypeText "This is paragraph 2."
            .TypeParagraph
            .TypeText "This is paragraph 3."
        End With
        With ActiveDocument
            .Paragraphs(1).Range.Words(3).Bold = True
            .Paragraphs(2).Range.Words(3).Italic = True
            .Paragraphs(3).Range.Words(3).Underline = True
        End With
    End Sub8. Press <F5> to run the code.
    A new Word session should have been launched. Switch to it, to view the results of our handiwork!
    TAILORING VBA CODE INTENDED FOR OLE2 CONVERSION
    Now, things get a bit uglier. The code listed above gives a good idea of how concise VBA code can be, but With blocks and chained object references do not translate readily into OLE2 code. Here's the same process, rewritten in a more OLE2-friendly style. Note the numerous intermediate object references that have been declared.
    Public Sub LaunchWord()
        Dim app As Word.Application
        Dim doc As Word.Document
        Dim docs As Word.Documents
        Dim pars As Word.Paragraphs
        Dim par As Word.Paragraph
        Dim wrds As Word.Words
        Dim sel As Word.Selection
        Dim rng As Word.Range
        Set app = CreateObject("Word.Application")
        app.Visible = True                          '!!! IMPORTANT !!!
        Set doc = app.Documents.Add
        Set sel = app.Selection
        sel.TypeText "This is paragraph 1."
        sel.TypeParagraph
        sel.TypeText "This is paragraph 2."
        sel.TypeParagraph
        sel.TypeText "This is paragraph 3."
        Set pars = doc.Paragraphs
        'select third word of first paragraph and make it bold
        Set par = pars.Item(1)
        Set rng = par.Range
        Set wrds = rng.Words
        Set rng = wrds.Item(3)
        rng.Bold = True
        'select third word of second paragraph and italicize it
        Set par = pars.Item(2)
        Set rng = par.Range
        Set wrds = rng.Words
        Set rng = wrds.Item(3)
        rng.Italic = True
        'select third word of second paragraph and underline it
        Set par = pars.Item(3)
        Set rng = par.Range
        Set wrds = rng.Words
        Set rng = wrds.Item(3)
        rng.Underline = True
    End Sub
    TRANSFORMATION: CONVERTING VBA CODE INTO PL/SQL
    Here is the PL/SQL counterpart to our previous VBA routine. Compare printouts of the two and note their similarities. Notice the need for argument lists -- this causes the code to fluff up quite a bit, and really interferes with readability.
    PROCEDURE LAUNCH_WORD IS
      v_app OLE2.OBJ_TYPE;     -- Application
      v_doc OLE2.OBJ_TYPE;     -- Document
      v_docs OLE2.OBJ_TYPE;    -- Documents collection
      v_pars OLE2.OBJ_TYPE;    -- Paragraphs collection
      v_par OLE2.OBJ_TYPE;     -- Paragraph
      v_wrds OLE2.OBJ_TYPE;    -- Words collection
      v_sel OLE2.OBJ_TYPE;     -- Selection
      v_rng OLE2.OBJ_TYPE;     -- Range
      v_args OLE2.LIST_TYPE;   -- OLE2 argument list
    BEGIN
      /* launch Word and MAKE IT VISIBLE!!! */ 
        v_app := OLE2.CREATE_OBJ('Word.Application');
        OLE2.SET_PROPERTY(v_app, 'Visible', TRUE);
      /* initialize key object references */ 
        v_docs := OLE2.GET_OBJ_PROPERTY(v_app, 'Documents');
        v_doc := OLE2.INVOKE_OBJ(v_docs, 'Add');
        v_sel := OLE2.GET_OBJ_PROPERTY(v_app, 'Selection');
      /* type first paragraph */
        v_args := OLE2.CREATE_ARGLIST;
        OLE2.ADD_ARG(v_args, 'This is paragraph 1.');
        OLE2.INVOKE(v_sel, 'TypeText', v_args);
        OLE2.DESTROY_ARGLIST(v_args);
        OLE2.INVOKE(v_sel, 'TypeParagraph');
      /* type second paragraph */
        v_args := OLE2.CREATE_ARGLIST;
        OLE2.ADD_ARG(v_args, 'This is paragraph 2.');
        OLE2.INVOKE(v_sel, 'TypeText', v_args);
        OLE2.DESTROY_ARGLIST(v_args);
        OLE2.INVOKE(v_sel, 'TypeParagraph');
      /* type third paragraph */
        v_args := OLE2.CREATE_ARGLIST;
        OLE2.ADD_ARG(v_args, 'This is paragraph 3.');
        OLE2.INVOKE(v_sel, 'TypeText', v_args);
        OLE2.DESTROY_ARGLIST(v_args);
      /* set reference to Paragraphs collection */
        v_pars := OLE2.GET_OBJ_PROPERTY(v_doc, 'Paragraphs');
      /* select third word of first paragraph and make it bold */
        v_args := OLE2.CREATE_ARGLIST;
        OLE2.ADD_ARG(v_args, 1);
        v_par := OLE2.INVOKE_OBJ(v_pars, 'Item', v_args);
        OLE2.DESTROY_ARGLIST(v_args);
        v_rng := OLE2.GET_OBJ_PROPERTY(v_par, 'Range');
        v_wrds := OLE2.GET_OBJ_PROPERTY(v_rng, 'Words');
        v_args := OLE2.CREATE_ARGLIST;
        OLE2.ADD_ARG(v_args, 3);
        v_rng := OLE2.INVOKE_OBJ(v_wrds, 'Item', v_args);
        OLE2.SET_PROPERTY(v_rng, 'Bold', TRUE);
      /* select third word of second paragraph and italicize it */
        v_args := OLE2.CREATE_ARGLIST;
        OLE2.ADD_ARG(v_args, 2);
        v_par := OLE2.INVOKE_OBJ(v_pars, 'Item', v_args);
        OLE2.DESTROY_ARGLIST(v_args);
        v_rng := OLE2.GET_OBJ_PROPERTY(v_par, 'Range');
        v_wrds := OLE2.GET_OBJ_PROPERTY(v_rng, 'Words');
        v_args := OLE2.CREATE_ARGLIST;
        OLE2.ADD_ARG(v_args, 3);
        v_rng := OLE2.INVOKE_OBJ(v_wrds, 'Item', v_args);
        OLE2.SET_PROPERTY(v_rng, 'Italic', TRUE);
      /* select third word of second paragraph and underline it */
        v_args := OLE2.CREATE_ARGLIST;
        OLE2.ADD_ARG(v_args, 3);
        v_par := OLE2.INVOKE_OBJ(v_pars, 'Item', v_args);
        OLE2.DESTROY_ARGLIST(v_args);
        v_rng := OLE2.GET_OBJ_PROPERTY(v_par, 'Range');
        v_wrds := OLE2.GET_OBJ_PROPERTY(v_rng, 'Words');
        v_args := OLE2.CREATE_ARGLIST;
        OLE2.ADD_ARG(v_args, 3);
        v_rng := OLE2.INVOKE_OBJ(v_wrds, 'Item', v_args);
        OLE2.SET_PROPERTY(v_rng, 'Underline', TRUE);
    END;
    REFACTORING FOR REUSABILITY AND READABILITY
    While the previous procedure runs without errors, it suffers from poor readability which, in turn, makes it difficult to maintain. Here, we address those issues by moving repetetive low-level operations into separate procedures.
      PROCEDURE LAUNCH_WORD IS
        v_app OLE2.OBJ_TYPE;    -- Application
        v_doc OLE2.OBJ_TYPE;    -- Document
        v_docs OLE2.OBJ_TYPE;   -- Documents collection
        v_sel OLE2.OBJ_TYPE;    -- Selection
        v_args OLE2.LIST_TYPE;  -- OLE2 argument list
      BEGIN
        /* launch Word and MAKE IT VISIBLE!!! */ 
          v_app := OLE2.CREATE_OBJ('Word.Application');
          OLE2.SET_PROPERTY(v_app, 'Visible', TRUE);
        /* create a new Word document */ 
          v_docs := OLE2.GET_OBJ_PROPERTY(v_app, 'Documents');
          v_doc := OLE2.INVOKE_OBJ(v_docs, 'Add');
          v_sel := OLE2.GET_OBJ_PROPERTY(v_app, 'Selection');
        /* add a few paragraphs */
          PRINT_PARAGRAPH(v_sel, 'This is paragraph 1.');
          PRINT_PARAGRAPH(v_sel, 'This is paragraph 2.');
          PRINT_PARAGRAPH(v_sel, 'This is paragraph 3.');
        /* apply formatting */
          APPLY_FORMATTING(v_doc, 1, 3, 'Bold', TRUE);
          APPLY_FORMATTING(v_doc, 2, 3, 'Italic', TRUE);
          APPLY_FORMATTING(v_doc, 3, 3, 'Underline', TRUE);
      END;
      PROCEDURE APPLY_FORMATTING(
        v_doc OLE2.OBJ_TYPE,
        v_paragraph_num NUMBER,
        v_word_num NUMBER,
        v_attribute VARCHAR2,
        v_value BOOLEAN) IS
        v_pars OLE2.OBJ_TYPE;   -- Paragraphs collection
        v_par OLE2.OBJ_TYPE;    -- Paragraph
        v_wrds OLE2.OBJ_TYPE;   -- Words collection
        v_rng OLE2.OBJ_TYPE;    -- Range
        v_args OLE2.LIST_TYPE;  -- OLE2 argument list
      BEGIN
        /* set reference to Paragraphs collection */
          v_pars := OLE2.GET_OBJ_PROPERTY(v_doc, 'Paragraphs');
        /* get specified paragraph */   
          v_args := OLE2.CREATE_ARGLIST;
          OLE2.ADD_ARG(v_args, v_paragraph_num);
          v_par := OLE2.INVOKE_OBJ(v_pars, 'Item', v_args);
          OLE2.DESTROY_ARGLIST(v_args);
        /* get words for specified paragraph */
          v_rng := OLE2.GET_OBJ_PROPERTY(v_par, 'Range');
          v_wrds := OLE2.GET_OBJ_PROPERTY(v_rng, 'Words');
        /* apply formatting to word found at specified index */
          v_args := OLE2.CREATE_ARGLIST;
          OLE2.ADD_ARG(v_args, v_word_num);
          v_rng := OLE2.INVOKE_OBJ(v_wrds, 'Item', v_args);
          OLE2.SET_PROPERTY(v_rng, v_attribute, v_value);
      END;
      PROCEDURE PRINT_PARAGRAPH(v_sel OLE2.OBJ_TYPE, v_text VARCHAR2) IS
        v_args OLE2.LIST_TYPE;
      BEGIN
        v_args := OLE2.CREATE_ARGLIST;
        OLE2.ADD_ARG(v_args, v_text);
        OLE2.INVOKE(v_sel, 'TypeText', v_args);
        OLE2.DESTROY_ARGLIST(v_args);
        OLE2.INVOKE(v_sel, 'TypeParagraph');
      END;
    CONCLUSION
    It is my hope that this tutorial, despite it's introductory nature, has demonstrated the value of the VBA IDE, the ease with which automation processes can be prototyped using VBA, the noticeable similarity between VBA automation routines and their Forms PL/SQL counterparts, and the advantages of testing automation processes within the VBA IDE. Please feel free to follow up with any specific questions or concerns you may have.
    Thanks,
    Eric Adamson
    Lansing, Michigan
    FINAL NOTE: These examples use the OLE2 built-in, and will operate correctly when called from forms running in the Form Builder OC4J. Deploying them to an Oracle Application Server will launch Word on the server itself (if available), which is usually not the developer's intent! Automating Word client-side via web forms requires adding WebUtil support. Adapting the code for WebUtil is trivial -- just replace all instances of OLE2 with CLIENT_OLE2. Adapting forms for WebUtil and configuring OLE support into your Oracle Application Server, however, are beyond the scope of this tutorial.
    REVISION HISTORY
    This promises to be something of a 'living document'. I've snuck changes through without comment in the past, but in the future, I'll try to document significant changes here.
    2006-08-21
      * Prefaced boring subject line with text: 'Tutorial:' to clarify purpose
      * Added emphasis on value of Object Browser as a reference

    Thanks James, for your kind words. I do hope this information will help folks out. I honestly believe that tinkering around in the VBA IDE will prove highly gratifying for automation developers. It can be assured that learning to make Word jump through hoops is much more straight-forward in this environment. I'm not one for mottos, but if I were pressed for a cheesy motto, I would say: First, make it work. Then, make it work in Oracle!
    Once the idea has sunk in, that Visual Basic routines for automating Word are exact analogs to their OLE2 counterparts, we can remove keywords like Oracle and PL/SQL from our Google searches on Word automation which, at least in this context, are the proverbial kiss of death. Suddenly we find ourselves liberated by the possibility of steal-, ahem... borrowing ideas from the Visual Basic* community!
    As for links, my link of choice is invariably http://groups.google.com -- if you don't already use it at least ten times a day, you must try it. This is the venerable USENET archive, including the holdings of now-extinct DejaNews. Another possible site of interest is http://word.mvps.org/FAQs/MacrosVBA, which may serve as a good starting point for those who wish to learn how to do fancy tricks with Word using VBA.
    If these links don't prove immediately helpful, please feel free to give specifics on the sort of operations you are interested in automating, and I'll see if I can post an example that addresses it.
    Regards,
    Eric Adamson
    Lansing, Michigan
    PS: I do hope, as people read my posts, with every other acronym being VBA, that they are not mistakenly hearing a call to learn Visual Basic. I say this, not because I believe learning VB would be a Bad Thing, but because I assume that few of us feel we have the time to learn a new programming language. Despite having come to the Oracle camp already knowing VB/VBA, and having acquired a fair bit of experience with automating Office applications as an Access developer, I remain confident that what I am suggesting people attempt does not rise to the level of learning a language. What I am suggesting is that they learn enough of the language to get by.
    *VB vs. VBA
    Just a quick word on this, as readers may wonder why I seem to use these terms interchangeably. Visual Basic (VB) can refer to either a development platform or a programming language. Visual Basic for Applications (VBA) is a language -- more precisely, it is a subset of the Visual Basic language. One purchases VB, usually quite intentionally. VBA is included with Microsoft Office, as is VBA's development environment, the VBA IDE. The key distinction between VB and VBA is that VBA cannot be used to create self-contained executables. Rather, VBA relies on VBA-enabled applications, such as Microsoft Office applications, to serve as a container for VBA code, and to provide a runtime environment for that code. For the purposes of discussing OLE Automation, VB and VBA are quite interchangeable.

  • OLE automation

    Auteur : Corinne Ribeyre-F085785 &agrave; _CARPO04
    I need help with OLE Automation implementation (Excel,
    CrystalReport,Word ...)
    I generate Excel project with OleGen but no documentation exist for
    this project. So I made severals tests (with Excel).
    I can do (see examples):
    - open a file
    - open Excel Application
    - open WorkBook, WoorkSheet
    - Write and Read a Cell (but I am not sure it's the more efficient
    method to do this)
    - run a macro with parameters
    But, I CAN'T do:
    - run a command with parameters like PivotTableWizard (tableau croise
    dynamique)
    Does a Documentation exist about Forte project generated by Olegen
    Tool (Excel..) ?
    Does a Documentation exist about Forte/Crystal Report ?
    Thank You for all answers and examples,
    Corinne
    Examples
    -- Open Excel
    theApplication : Excel . Application = New;
    theApplication . CreateUsingProgID(NX('excel.application'));
    --- Excel Visible /not visible
    theApplication . Visible = VariantBoolean(Value = False);
    -- Get all WorkBooks of Excel Application
    theWorkBooks : Excel . WorkBooks = New;
    theWorkBooks . SetDispatchObject(theApplication . Workbooks());
    -- Open File.xls (added with previous Application)
    theWorkBooks . Open (VariantString(Value = 'C:\\temp\\File.xls'));
    -- Link file with a WorkBook
    aWorkBook : Excel . WorkBook = New;
    aWorkBook . SetDispatchObject(theApplication .
    Workbooks(VariantString(value='File.xls')));
    -- Link a Folder (Sheet1) from File with WorkSheet
    aWorksheet : Excel . Worksheet = New;
    aWorksheet . SetDispatchObject(aWorkBook .
    Worksheets(VariantString(value='Sheet1')));
    aRange : Excel . Range = New;
    -- Fill Cell (1,1) with 'Article'
    TitreArt : VariantString = VariantString(Value = 'Article');
    aRange . SetDispatchObject(aWorksheet . Cells(VariantInteger(Value =
    1), VariantInteger(Value = 1)));
    aRange . Value = titreArt;
    -- Fill Cell (1,2) with 'Date'
    TitreDate : VariantString = VariantString(Value = 'Date');
    aRange . SetDispatchObject(aWorksheet . Cells(VariantInteger(Value =
    1), VariantInteger(Value = 2)));
    aRange . Value = TitreDate;
    -- Run a Macro
    theApplication . Run(VariantString(Value = NX('MacroName')),
    VariantInteger(Value = 65),
    VariantInteger(Value = 7));
    -- Page Setup
    -- Link a Folder (Sheet2) from File with WorkSheet
    aWorksheet . SetDispatchObject(aWorkBook .
    Worksheets(VariantString(value='Sheet2')));
    aPageSetup : Excel . PageSetUp = New;
    aPageSetup . SetDispatchObject(aWorksheet.PageSetup);
    aPageSetup . PrintTitleRows = VariantString (Value = '');
    aPageSetup . PrintTitleColumns = VariantString (Value = '');
    aPageSetup . LeftHeader = VariantString (Value = 'MICKEY');
    aPageSetup . CenterHeader = VariantString (Value = 'MOUSE');
    aPageSetup . RightHeader = VariantString (Value = '&J &H'); --
    Attention J H en Excel Fran&ccedil;ais; D T en Anglais
    aPageSetup . LeftFooter = VariantString (Value = '');
    aPageSetup . CenterFooter = VariantString (Value = 'DISNEYLAND
    PARIS');
    aPageSetup . RightFooter = VariantString (Value = '&P / &T');
    aPageSetup . LeftMargin = VariantInteger(Value = 1);
    aPageSetup . RightMargin = VariantInteger(Value = 1);
    aPageSetup . TopMargin = VariantInteger(Value = 1);
    aPageSetup . BottomMargin = VariantInteger(Value = 1);
    aPageSetup . HeaderMargin = VariantDouble(Value = 0.5);
    aPageSetup . FooterMargin = VariantDouble(Value = 0.5);
    aPageSetup . PrintHeadings = VariantBoolean(Value = False);
    aPageSetup . PrintGridlines = VariantBoolean(Value = False);
    aPageSetup . PrintNotes = VariantBoolean(Value = False);
    aPageSetup . CenterHorizontally = VariantBoolean(Value = True);
    aPageSetup . CenterVertically = VariantBoolean(Value = True);
    aPageSetup . Orientation = VariantInteger(Value = 2); --
    (1:xlPortrait, 2:xlLandscape)
    aPageSetup . Draft = VariantBoolean(Value = False);
    aPageSetup . PaperSize = VariantInteger(Value = 9);
    -- (8: xlPaperA3, 9: xlPaperA4)
    aPageSetup . FirstPageNumber = VariantInteger(Value = -4105);
    -- xlAutomatic
    aPageSetup . Order = VariantInteger(Value = 1);
    -- xlDownThenOver
    aPageSetup . BlackAndWhite = VariantBoolean(Value = True);
    aPageSetup . Zoom = VariantBoolean(Value = False);
    aPageSetup . FitToPagesWide = VariantInteger(Value = 1);
    aPageSetup . FitToPagesTall = VariantInteger(Value = 1);
    -- Save File
    aFilename : VariantString = VariantString(Value =
    NX('C:/Temp/Essai.xls'));
    aWorkBook . SaveAS(FileName = aFilename);
    -- Print File
    PrintOptions : PrintOptionsDesc;
    PrintOptions = Self . Window . WindowSystem . DefaultPrintOptions .
    Clone (Deep = True);
    If (self.Window.PrintDialog (PrintOptions= PrintOptions,
    ShowSetupDialog = TRUE,
    ShowJobDialog = FALSE) = BV_OK) Then
    aWorksheet . PrintOut();
    End If;
    -- Unlink
    aWorkBook . RunAutoMacros(VariantInteger(Value = 2)); --xlAutoFermer 
    -- Cf doc VBA
    aWorkBook . Close(variantboolean (Value = False));
    TheApplication . Quit();
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

    Hi all, forget this silly question...
    I studied a little bit and learned how to handle OLEs properly...
    Many thanks

  • Re: OLE Automation

    Venkat,
    We have also had problems with OLE automation. In our case, we were trying
    to open Lotus WordPro from our Forte Application. There are definitely
    some issues with Forte releasing system resources, particularly if you are
    working across tasks. In our case, one task was requesting a session which
    then got started from another task. This meant that when we were finished,
    Forte incorrectly kept the count of apps using the session > 0, and the
    session never ended. I suspect if you check the task manager you will see
    multiple sessions of Impromptu running. This quickly eats up memory, which
    in turn leads to the less than gracious OLE_RESOURCE crash you describe.
    Even after restricting all related calls to one task, the WordPro session
    never goes away completely. We did manage to reconnect to any first
    session started rather than eating up system resources with multiple
    sessions.
    Hope this helps.
    Sioban Keane
    NAC Re
    We communicate between Forte and our Reporting tool, Impromptu, through
    OLE.
    Our clients run on all three Microsoft OS. Our version of Impromptu is 16
    bit.
    We notice this problem predominantly in Win 95 and 3.11, sometimes on NT
    4.0. When we run a report in Impromptu that has considerable data (
    ~30-50k), Impromptu fails to respond to Forte. Forte thinks that it is not
    started Impromptu yet. We have code in place to retry for 10 times before
    giving up. Forte gives up after 10 times, even though Impromptu is up. The
    next time we run this report on the same machine, without restarting, we
    get
    a OLE_RESOURCE exception from Forte, and the application crashes.
    Has any one noticed this problem? Is there a way from Forte, to control OLE
    resources?
    Any help will be appreciated.
    Venkat Kodumudi
    Price Waterhouse LLP
    Internet: [email protected]
    Internet2: [email protected]

    Hi Joaquin,
    For inserting many lines you should better use the OO technique instead of OLE. Check the help on Desktop Office Integration (e.g. for 4.6C):"
    http://help.sap.com/saphelp_46c/helpdata/en/e9/0bee9f408e11d1893b0000e8323c4f/frameset.htm
    Regards,
    John.

  • Discoverer 3i through ole automation

    Do you know,
    where to find information about using ole automation with Discoverer 3i.

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by jr vasquez ([email protected]):
    Also, is there a method of bypassing the authentication and passing arguments into Discoverer rather than having to login? If I am maintaining a userlist in another application can I not use that authentication method and pass that into Discoverer?<HR></BLOCKQUOTE>
    For the Client server application, You can bypass login by passing parameters to the application. This is documented in the Discoverer User's Guide, Under Advanced Features, Using Command Line Options.
    Discoverer Viewer and Discoverer Plus (java) also permit this through the urls used to launch the application. This is also documented.
    Documentation for Discoverer OLE Automation may be found via Oracle Metalink. Type in 'Discoverer, OLE' in the search window and a technical bulletin, "Programmatic Control of Discoverer 3.1", will be returned.

  • OLE Automation , date formatting

    Hi everybody,
    i have a problem with OLE automation for "date" formatting.
    The cell value is correct ( DD/MM/YYYY) , but in some cases the cell option is "Date" ( this is the correct option ) and in other cases the cell option is "General". This last option is wrong because the value is left-justified, meanwhile the "Date" option is right-justified.
    I wish to have the "Date" cell option always. (right-justified)
    Is it possible to set this option with statement "SET PROPERTY OF..." ?
    Thanks in advance.
    Best regards.
    Dario.

    Hi,
    you can use this:
      SET PROPERTY OF H_CELL 'NumberFormat' =
                             'dd\/mm\/yyyy'.
      SET PROPERTY OF H_CELL 'Value'        = '01/01/2012'.
    Regards, Dieter

  • OLE Automation is not working in Portal

    Hi Experts,
    We have one report where OLE automation technique is used to upload the data from multiple worksheets (single excel).
    But when we try to execute it from Portal using IView then it doesn't run and give problem in CREATE OBJECT excel "EXCEL.APPLICATION" statement. But when we run it from SAP GUI, it run successfully.
    Please suggest if you have any idea.
    Also let me know if some more information required because i am new to this kind of issue. 
    regards
    Subir

    Hi,
    Are you using SAP GUI for HTML??? There are several issues and limitations with OLE using HTML.
    Look this OSS: 314568
    Hope this helps,
    Iván.

  • LabVIEW Run Time Engine and ActiveX Automation Server

    Hi,
    I have a question related to LabVIEW Run Time Engine and ActiveX Automation Server:
    We have a tool developed in LabVIEW and TestStand. End user interface is a LabVIEW GUI (it's an executable) which executes TestStand sequences. Some TestStand sequences call lower level LabVIEW VIs.
    Everything works fine with LabVIEW installed, but I was wondering if I could run this tool on deployment machine with only LabVIEW run time engine installed. We are using LabVIEW 6.1 and with only the run time engine installed, I get the error message: "Unable to launch the 'LabVIEW.Application' ActiveX automation server ". 
    BTW, we are planning to upgrade the versions soon.
    Is it possible to make things work only with the run time engine?
    Thank you.

    Thanks for the response, Brian.
    I did upgrade to LabVIEW 8.0 and TestStand 3.5. Everything works fine on the development computer where LabVIEW and TestStand is installed. On the target computer in the lab, I installed LV RTE 8.0 and TestStand 3.5, and now when a VI is called in a sequence file, I get the following:
    RunState.PreviousStep.Result.Error.Code  -18002 
    RunState.PreviousStep.Result.Error.Msg  "LabVIEW: The VI is not executable"
    So, the executable opens and works fine (which means that the LV RTE is installed properly), but when a sequence calls a low level VI, it does not make it through.
    comments/suggestions are appreciated. Thanks.

  • During iTunes installation "Registering iTunes automation server"... I am getting following error messag from "Microsoft visual C   runtime Library"... Runtime Error! Program: C:\program files (x86)\iTunes\iTunes.exe

    During iTunes installation, when it comes to installation phase "Registering iTunes automation server"... I am getting following error message:
    "Microsoft visual C++ runtime Library"...
    "Runtime Error! Program: C:\program files (x86)\iTunes\iTunes.exe"
    "R6034
    An application has made an attempt to load the C runtime library incorrectly. Please contact the application's support team for more information."
    My system is Windows 7 Enterprise - Service Pack1

    Check the user tip below.
    https://discussions.apple.com/docs/DOC-6562

Maybe you are looking for

  • New to java: how to replace an image extending a JComponent?

    Hi, I'm new to Java and I have a question about Swing: I have a class called ActiveImage (entends JComponent, implements     MouseMotionListener, MouseWheelListener) which takes an Image and displays it. It also receives some mouse events for zooming

  • Error while creating KM Global Service

    Hi Experts,    I have created one KM Global Service from the <b> com.sap.netweaver.kmc.globalservice.zip</b> file.  I have downloaded this zip file from <a href="https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/com.sap.km.cm.docs/library/nw/netweave

  • Adobe Bridge CS4 window will not open MAC

    I was using Bridge CS4 on a MAC OSX 10.6.8 yesterday and all was fine. Today when I went to use Bridge, there was no window open. Bridge started up and appeared normal. However, there is no window. When I select "new Window" nothing happens. I uninst

  • New Hard Disc Drive for HP Pavilion dv6 because of 303 and 305 error messages

    Hello My laptop was getting slower and slower so I did a default restore via the recovery partition and when it rebooted to start the reformat and reinstall to factory condition I got a message on the screen telling me to run the hard disc drive test

  • BADI-Shopping cart number to Tracking Number in PR

    Hi, Is there any BADI  is  used for populating shopping cart number in the tracking field in the backend PR.We are using classic scenario. or how a shopping cart number can be populated in the bakend(R/3) in tracking number field. With Regards Sri. E