Showing results 1 to 2 of 2

Thread: Cannot add VBA macro to the function

  1. #1
    ekk Gast

    Default Cannot add VBA macro to the function

    I tried to add VBA macro to the function and nothing happen.
    I am stuck at pop up dialog box "macro".
    I just want to know how do I create macro to use in my function.

  2. #2

    Default Re: Cannot add VBA macro to the function

    Macros which can be used in the function "execute VBA macro" can be e.g. placed in "thisproject" in the VBA editor, and most not have any parameters.

    a "Sub testMyMacro() ... End Sub" will work, but a Macro "Sub testMyMacro2(myString as String) ... End Sub" will not.

    This will actually change with the next zenon version, where parameters for VBA macros will be available.

    Alternatively, a VBA macro can be created to be triggered after an event, e.g. a LeftClickUp event of a button. For this, create a macro in the scripting node of the project tree, under ModuleElement - > LeftClickUp, and link this VBA Macro at the button you want to use it with.

    Please also see the zenon Documentation for more information on how to use VBA in your projects.

Similar Threads

  1. How to create a new MACRO?
    By matholton in forum VBA
    Replies: 2
    Last Post: 24th September 2008, 12:14
  2. Start a VBA Macro with PCE
    By mrk in forum VBA
    Replies: 1
    Last Post: 21st March 2008, 17:43

Posting Rules

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