Showing results 1 to 3 of 3

Thread: How to create a new MACRO?

  1. #1
    matholton Gast

    Default How to create a new MACRO?

    Hi there!

    I'm very new to thsi Zen0n stuff so please bear with me.

    I have a simple question: I want an action to occur when I click a button.

    So I:

    1. Create a new Picture
    2. Add a button
    3. Goto Button properties
    4. Choose VBA
    5. Click on LeftclickDown
    6. Option to select Macro - but there is nothing in the Macro List

    So, how do I create a macro?

    PS. I am currently only using the Demo Version - we're waiting for the real thing to come in the post!

    Thanks in advance,

    Mat

  2. #2
    Join Date
    30.05.2007
    Location
    Salzburg
    Posts
    881

    Default Re: How to create a new MACRO?

    You prior have to create the LeftclickDown event.

    Proceed as follow:
    - at the Project tree go to Scripting -> VBA Macros
    - right-click on the event (in your case LeftclickDown)
    - after enter the name and pressing ENTER the VBA IDE will open at the new created module:

    Public Sub LeftClickDown_Default(obElem As Element)

    End Sub


    In this sub you can insert the code which should be executed in the runtime when pressing on the button

    Finally you have to link the LeftclickDown event to the button (in the selection the created Event should be displayed now)

    FYI: in most cases the LeftclickUp Event is the better choice than the LeftclickDown Event


    Regards,
    Herbert
    Attached Thumbnails Attached Thumbnails CreateVBAMacro.jpg  

  3. #3

    Default Re: How to create a new MACRO?

    Quote Originally Posted by matholton View Post
    Hi there!

    I'm very new to thsi Zen0n stuff so please bear with me.

    I have a simple question: I want an action to occur when I click a button.

    So I:

    1. Create a new Picture
    2. Add a button
    3. Goto Button properties
    4. Choose VBA
    5. Click on LeftclickDown
    6. Option to select Macro - but there is nothing in the Macro List

    So, how do I create a macro?

    PS. I am currently only using the Demo Version - we're waiting for the real thing to come in the post!

    Thanks in advance,

    Mat
    Please note, that there are many zenon standard functions, which can be configured to be executed when a button is pressed. A zenon function does not require any programming. A function to call another a picture, or to start an archive, is just clicked together and can be linked to the button in the properties window, or by using drag&dop

    Normally VBA is only required for very special functionality for which zenon does not offer standard functions.

Similar Threads

  1. Create a function for a trend picture
    By robertf in forum VBA
    Replies: 8
    Last Post: 4th October 2018, 14:33
  2. Create an Element
    By robertf in forum VBA
    Replies: 7
    Last Post: 11th June 2014, 07:44
  3. 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
  •