Options

Strange error when trying to create global word automation

AntidotEAntidotE Member Posts: 61
Using NAV 5.0 AT
Wherever I try to add global variable of Word.Application automation, I get this error. Who knows, why?
If I try to delete it, confirmation appears...
P.S. If I create local var, everything is ok...
It is hard to swim against self bloodstream... (c) Old, experienced kamikadze.

Comments

  • Options
    garakgarak Member Posts: 3,263
    edited 2008-10-02
    The first message means, that the property WithEvents is set to true.

    The second error message is since word 12 library (NAV has here a problem with the Name length of the classes and functions)
    Do you make it right, it works too!
  • Options
    Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    To solve the 2nd issue, try shorten your variable-name.

    A note regarding the use of images in your posting: It is waste of diskspace/bandwidth to save a NAV-error message as image and upload it to the forum. You can just as easily use Ctrl-C on the error-message in NAV, and press Ctrl-V in the message-body in this forum. This way, the error-message is shown as text.
    This will give us exact the same information, but without wasting diskspace and without slowing down the forum.
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • Options
    AntidotEAntidotE Member Posts: 61
    @Luc Van Dyck
    I've tried even 1-char variable - the same error...

    Microsoft Dynamics NAV
    The variable W::MAILMERGEDATASOURCEVALIDATE is defined more than once.
    An example could be: 'File' exists as both a data type and a global variable.
    OK

    moreover, it is my 1st global variable as word12.application automation.

    @garak
    I didn't do anything special, just ran NAV, opened base, designed codeunit/form/table/etc, tried to add global word12.application automation... it was added, but doesn't allow me to compile object i'm designing - error appears... If I try to delete this variable, I get:

    Microsoft Dynamics NAV
    There are event triggers associated to the global variable w. Deleting the variable will delete the event triggers and their code.
    Are you sure that you want to delete this global variable?
    Yes No
    I didn't add/change any triggers!
    It is hard to swim against self bloodstream... (c) Old, experienced kamikadze.
  • Options
    AntidotEAntidotE Member Posts: 61
    Have just tried it on 5.0 and 6.0 NAV on different workstations...
    The same!
    It seems to be Automation issue...

    Don't anyone else has same :bug:?
    It is hard to swim against self bloodstream... (c) Old, experienced kamikadze.
  • Options
    garakgarak Member Posts: 3,263
    yes it's a "problem" with library 12. Use for example Library 11. These Library works also for word 12.

    Regards
    Do you make it right, it works too!
  • Options
    kinekine Member Posts: 12,562
    Exactly as Garak wrote, my colleague had same problem few days ago. v12 library have some functions, which have difference in the name too far from beginning and NAV is using only the part which is same (variable name length limit in NAV) and it is why it looks for NAV as same names of functions. There is only one workaround - use the older versions of library, but you need to find them somewhere. My colleague succeeded by copying the automations from some older PC to his and register them.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • Options
    garakgarak Member Posts: 3,263
    edited 2008-12-16
    So, last day i was by a customer and must there develop a little module for word in NAV. And he has Word 12. No Word 11 available :-(
    So i got the same error message, but i could help me (after a pause to think) ;-)

    I "added" the WordApp Variable 'Microsoft Word 12.0 Object Library'.Application. then is saved my object but doesn't compile it.
    After that is export it as text and open it with notepad. I search for "MAILMERGEDATASOURCEVALIDATE" and i see, oh, there are two events defined in the textfile with the same name (the last one has only a 2 at the end) So i delete this event from the textfile (because in my solution i doesn't need events). Then i import the textfile, open it from object designer and compile it. Wow, it works ;-)

    A other, more simple, way is to use the variable as "local" and not as global. But this is not ever possible ......

    Regards
    Do you make it right, it works too!
  • Options
    BeliasBelias Member Posts: 2,998
    declare the variable "local"...and it will be ok!
    :oops: didn't see at all...
    P.S. If I create local var, everything is ok...
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • Options
    AntidotEAntidotE Member Posts: 61
    garak wrote:
    So, last day i was by a customer and must there develop a little module for word in NAV. And he has Word 12. No Word 11 available :-(
    So i got the same error message, but i could help me (after a pause to think) ;-)

    I "added" the WordApp Variable 'Microsoft Word 12.0 Object Library'.Application. then is saved my object but doesn't compile it.
    After that is export it as text and open it with notepad. I search for "MAILMERGEDATASOURCEVALIDATE" and i see, oh, there are two events defined in the textfile with the same name (the last one has only a 2 at the end) So i delete this event from the textfile (because in my solution i doesn't need events). Then i import the textfile, open it from object designer and compile it. Wow, it works ;-)

    Regards

    If I have time, I'll rewrite my solution, which uses only locals :?
    But it works :-k

    P.S. Thanks for direction =D>
    It is hard to swim against self bloodstream... (c) Old, experienced kamikadze.
Sign In or Register to comment.