Showing results 1 to 6 of 6

Thread: VBA doesn`t work in Runtime

  1. #1

    Default VBA doesn`t work in Runtime

    Hi,

    Have a problem with VBA in Zenon 7.0 SP0.
    I have created simple macro in thisProject:

    Public Sub Message ()
    MsgBox "NEW MESSAGE"
    End Sub

    also I made a function to execute this macro.
    But it doesn`t work in runtime. It works fine when I manually start macro in Editor, but not in Runtime. I also tried simple LeftClickUp macro and function "Show VBA macro dialog" - they also don`t work.

    I checked zenon6.ini. Here are the settings:

    [VBA]
    EIN=1
    EVENT=1
    UPDATE=0

    What`s wrong with my project?

  2. #2
    josefm Gast

    Default Re: VBA doesn`t work in Runtime

    Hi,

    here it is working properly.

    Although I thought macros have to start with "Macro" and then whatever you want to name it is not true.
    I attached a screenshot of my macros.

    Have you loaded several projects at the same time? Then I suggest to check in which of the thisProject you created the macros, there is a chance that you have chosen the wrong project file.
    Also a screenshot attached.

    My code:
    Public Sub Test()
        MsgBox "New Message"
    End Sub
    Public Sub Macro_Message()
        MsgBox "New Message"
    End Sub

    Maybe you havent saved and compiled the project ?!

    Please let me know how you proceeded.


    Best regards,
    Attached Thumbnails Attached Thumbnails VBA Macros.PNG   VBA Projects.png  

  3. #3

    Default Re: VBA doesn`t work in Runtime

    Quote Originally Posted by josefm View Post
    Maybe you havent saved and compiled the project ?!

    Please let me know how you proceeded.
    I can't see any principal difference between yours and my code) But I'm sure that I have compiled and saved my project properly. In my workspace is only one project.

    In the attachment is backup of project.

    May this problem occur because of license or something else?

    Regards, Nataliia
    Attached Files Attached Files

  4. #4

    Default Re: VBA doesn`t work in Runtime

    Hi Nataliia,

    Is your runtime license a zenon operator license? In that case VBA is not available.

    Best regards,
    Mark

  5. #5

    Default Re: VBA doesn`t work in Runtime

    Quote Originally Posted by markclemens View Post
    Is your runtime license a zenon operator license? In that case VBA is not available.
    Damn, I see. I have zenon operator.
    Thank you for clarifying, Mark.

    Regards, Nataliia

  6. #6
    Join Date
    20.08.2009
    Posts
    293

    Default AW: Re: VBA doesn`t work in Runtime

    Quote Originally Posted by josefm View Post
    Although I thought macros have to start with "Macro" and then whatever you want to name it is not true.
    This is only true for VSTA macros.

Similar Threads

  1. Replies: 1
    Last Post: 19th May 2011, 05:54
  2. Replies: 3
    Last Post: 31st March 2011, 09:23
  3. Replies: 5
    Last Post: 14th September 2010, 12:53
  4. Allocation from zenOn to Straton doesn't work?
    By sbc in forum straton / zenon Logic
    Replies: 1
    Last Post: 9th February 2009, 13:21
  5. Network doesn't work on Windows CE devices
    By sebastiank in forum zenon Operator
    Replies: 0
    Last Post: 28th August 2007, 12:11

Posting Rules

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