+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Super Member
    Computer Details
    wannabe's Computer Details
    Operating System:
    XP
    Using
    AutoCAD 2007
    Join Date
    Oct 2008
    Location
    Birmingham, UK
    Posts
    772

    Default VBA - Referencing a sub

    Registered forum members do not see this ad.

    I'm not sure if I have used the correct terminology here, but anyway; what I want to do is creat a form that will execute two of my macros that are in the same project, and have already been created.

    My form is laid out with the two buttons and label, and all that is required is for me to add the code to the two buttons that will call the subs.

  2. #2
    Super Member
    Computer Details
    wannabe's Computer Details
    Operating System:
    XP
    Using
    AutoCAD 2007
    Join Date
    Oct 2008
    Location
    Birmingham, UK
    Posts
    772

    Default

    Don't worry I found what I was looking for using RunMacro.

  3. #3
    Senior Member borgunit's Avatar
    Using
    Mechanical 2006
    Join Date
    May 2007
    Location
    Ohio USA
    Posts
    287

    Default

    Also I might add, you can call a subroutine by using CALL YOURSUBROUTINE within the sub on the form. You can also (if you are calling a function - returns some value - instead of a sub)
    ie iInteger = YOURFUNCTIONTHATRETURNSANINTEGER
    AutoCAD Mechanical 2006
    XP PRO SP3
    http://mechcad-insider.blogspot.com/

  4. #4
    Super Member SEANT's Avatar
    Using
    AutoCAD 2012
    Join Date
    Aug 2005
    Location
    Rhode Island
    Posts
    1,968

    Default

    Registered forum members do not see this ad.

    Quote Originally Posted by borgunit View Post
    Also I might add, you can call a subroutine by using CALL YOURSUBROUTINE within the sub on the form. You can also (if you are calling a function - returns some value - instead of a sub)
    ie iInteger = YOURFUNCTIONTHATRETURNSANINTEGER
    Shouldn't that really be:

    iInteger = YOURFUNCTIONTHATRETURNSANINTEGER()

Similar Threads

  1. Referencing a Tag in a Block with VBA
    By Tracer123 in forum AutoCAD General
    Replies: 0
    Last Post: 29th Jul 2008, 07:25 pm
  2. Opinions Please - PS Layout's with referencing viewports
    By StykFacE in forum AutoCAD Drawing Management & Output
    Replies: 18
    Last Post: 18th Mar 2008, 05:46 pm
  3. Finding all files referencing an x-ref
    By drahcir in forum AutoCAD Drawing Management & Output
    Replies: 1
    Last Post: 28th Jun 2007, 12:38 pm
  4. Auto-referencing
    By capac in forum AutoCAD Beginners' Area
    Replies: 3
    Last Post: 13th Oct 2006, 06:26 pm
  5. Referencing an Excel File
    By WwhawkwW in forum AutoCAD General
    Replies: 1
    Last Post: 2nd Nov 2005, 09:50 am

Bookmarks

Posting Permissions

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