Showing results 1 to 8 of 8

Thread: Using VSTA instead VBA V.6

  1. #1
    Join Date
    20.05.2013
    Posts
    15

    Frage Using VSTA instead VBA V.6

    Hello.
    I little confuse, because VBA Ver. 6 is deprecated MS technology. And MS suggest use VBA.NET, but in Zenon in most case i can't full functional replace VBA to new supper-puper .NET.
    Besides, in 64bit system some code not work properly, ActiveX Listview control not available.
    If you want use Event handler, for example left mouse click, Zenon show only list of VBA scripts.
    I can use action "execute function" and select VSTA macro, but this is macro call without parameter, such as Element.
    Can I call VSTA macro from legacy VBA?And in this way implement wrapper for Zenon?
    PS All above for Zenon 7.10 SP0.
    Last edited by hyper_sonic : 27th August 2013 at 11:30 Reason: add Zenon version

  2. #2
    Join Date
    20.05.2013
    Posts
    15

    Default Re: Using VSTA instead VBA V.6

    Quote Originally Posted by hyper_sonic View Post
    Hello.
    I little confuse, because VBA Ver. 6 is deprecated MS technology. And MS suggest use VBA.NET, but in Zenon in most case i can't full functional replace VBA to new supper-puper .NET.
    Besides, in 64bit system some code not work properly, ActiveX Listview control not available.
    If you want use Event handler, for example left mouse click, Zenon show only list of VBA scripts.
    I can use action "execute function" and select VSTA macro, but this is macro call without parameter, such as Element.
    Can I call VSTA macro from legacy VBA?And in this way implement wrapper for Zenon?
    PS All above for Zenon 7.10 SP0.
    May be i found answer for my question here:
    http://www.copadata.com/forums/showthread.php?t=1400

  3. #3
    josefm Gast

    Default Re: Using VSTA instead VBA V.6

    Hi,

    this might be a weird workaround, but I know that it is possible to call "zenon functions" via VBA. So you can create a zenon function to call a VSTA macro and this function can be called via VBA and the linked VBA Event for example "LeftMouseUp", etc.

    Maybe this could help you.


    With best regards,
    Josef

  4. #4

    Default Re: Using VSTA instead VBA V.6

    Hi hyper_sonic,

    The post you are referring to shows an example of the VSTA events for the DynPictures object. While it is not 100% identical with how you react on and use button events in VBA, the outcome can be the same using VSTA.

    I would try and use the VSTA events rather than mixing VBA and VSTA and executing a function to execute a VSTA macro.

    Best regards,
    Mark

  5. #5
    Join Date
    20.05.2013
    Posts
    15

    Default Re: Using VSTA instead VBA V.6

    Quote Originally Posted by markclemens View Post
    Hi hyper_sonic,

    The post you are referring to shows an example of the VSTA events for the DynPictures object. While it is not 100% identical with how you react on and use button events in VBA, the outcome can be the same using VSTA.

    I would try and use the VSTA events rather than mixing VBA and VSTA and executing a function to execute a VSTA macro.

    Best regards,
    Mark
    Thank your answer, I'm choose with decision VSTA events. You're right handlers implementation do in some other way, but i guess it is more useful.

  6. #6
    Join Date
    20.05.2013
    Posts
    15

    Default Re: Using VSTA instead VBA V.6

    Quote Originally Posted by hyper_sonic View Post
    Thank your answer, I'm choose with decision VSTA events. You're right handlers implementation do in some other way, but i guess it is more useful.
    For common case it is worked, but i can't cause event from mouse click on element in context menu. Should I use VBA?
    Last edited by hyper_sonic : 28th August 2013 at 13:03

  7. #7

    Default Re: Using VSTA instead VBA V.6

    Hi hyper_sonic,

    Also in VBA you cannot specify an event for the click event on an entry of the context menu. ( you can specify the action type, and change it to a function, or e.g. a VBA macro)

    What is it exactly that you would like to do in the context menu?

    Best regards,
    Mark

  8. #8
    Join Date
    20.05.2013
    Posts
    15

    Default Re: Using VSTA instead VBA V.6

    Quote Originally Posted by markclemens View Post
    Hi hyper_sonic,

    Also in VBA you cannot specify an event for the click event on an entry of the context menu. ( you can specify the action type, and change it to a function, or e.g. a VBA macro)

    What is it exactly that you would like to do in the context menu?

    Best regards,
    Mark
    Yes, i know. But i want use VSTA to write code with some GUI forms. And most important in case action is VBA macro, you have parameter (Element) reference to graph symbol on screen: "Init_Default (obElem As Element)" .
    How i can do it in VSTA?

Similar Threads

  1. LeftClickUp VBA, to LeftClickUp VSTA
    By softart2 in forum VSTA
    Replies: 6
    Last Post: 18th June 2014, 20:47
  2. Import Step7 Projekt mit VBA/VSTA Wizard
    By ptkdennis in forum VSTA
    Replies: 1
    Last Post: 18th July 2012, 09:55
  3. Return using VBA and VSTA
    By croc in forum VBA
    Replies: 2
    Last Post: 6th April 2012, 13:22
  4. VSTA Startproblem
    By stimpfig in forum VSTA
    Replies: 4
    Last Post: 23rd February 2010, 15:47

Posting Rules

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •