Showing results 1 to 6 of 6

Thread: Execute VBA Macro

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    30.03.2016
    Posts
    35

    Default Execute VBA Macro

    Hello

    It looks that the function execute vba macro does not work when the sub contains a parameter
    It works only if you have a sub without parameter Sub test()  Sub test (mstring As String) does not work

    I use zenon 7.50

    Is this correct? or did I do something wrong??

    Thanks in advance



  2. #2
    Join Date
    15.09.2016
    Posts
    59

    Default Re: Execute VBA Macro

    The function works.



    You must first add the needed Parameter and then you can see the Macro in the Selection.









    Sub Export(Fkt As String, Pic As String)
    Set MyPic = thisProject.DynPictures.Item(Pic)
    Set Myfunction = thisProject.RtFunctions.Item(Fkt)


    ar_Report is the Name of a Picture and fc_print_Archive is the Name of a function

  3. #3
    Join Date
    30.03.2016
    Posts
    35

    Default Re: Execute VBA Macro

    Hi,

    I did exactly the same. But here it is not working. I put a "stop" statement in the sub to see if the sub is called. nothing happens,

    Which build are you using and from wher are you calling the function. I call the function from startfunction of a picture.

    If I don't use any parameters in the sub then the sub will run.

  4. #4
    Join Date
    15.09.2016
    Posts
    59

    Default Re: Execute VBA Macro

    I donīt Know if it works with the stop.
    or perhaps there is a Bug in your Sub
    I use Messageboxes for debugging.

    I use one at the beginning, one in the end and one whenever i think there could be a ploblem.
    so i can see exactly where is the fault.
    it is a bit complicated but it works

    MessageBox ("Start")

  5. #5
    Join Date
    15.09.2016
    Posts
    59

    Default Re: Execute VBA Macro

    Quote Originally Posted by Joulzer View Post
    Hi,

    I did exactly the same. But here it is not working. I put a "stop" statement in the sub to see if the sub is called. nothing happens,

    Which build are you using and from wher are you calling the function. I call the function from startfunction of a picture.

    If I don't use any parameters in the sub then the sub will run.


    I use this



    I Call my Subs in many different ways. I use them as Button function, Start function of a Picture, Limit Value function and i use Element Macros which are called directly by klicking on an Element without a Runtime Function.
    But you can't use "Execute VBA-Makros" funktions in a script.

  6. #6
    Join Date
    30.03.2016
    Posts
    35

    Default Re: Execute VBA Macro

    thanks.

    I have a the latest build of 7.50

Similar Threads

  1. Replies: 2
    Last Post: 3rd February 2017, 13:10
  2. Replies: 0
    Last Post: 21st November 2014, 15:27
  3. Execute function in VBA
    By focus in forum VBA
    Replies: 1
    Last Post: 17th January 2012, 15:17
  4. Execute VBA macro
    By captain in forum VBA
    Replies: 1
    Last Post: 24th November 2009, 23:58
  5. Replies: 1
    Last Post: 11th June 2009, 08:02

Posting Rules

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