+ Reply to Thread
Results 1 to 2 of 2

opening a VBA file and runing its macro

  1. #1
    Registered User
    Join Date
    12-27-2012
    Location
    Panama
    MS-Off Ver
    Excel 2007
    Posts
    90

    opening a VBA file and runing its macro

    Good day,

    Using VBA,

    I want to open a work book and run the macro in the opened file,

    From File 1,
    Workbooks.Open Filename:= File 2
    Run macro in File 2

    Since the macro is in a different module, would I have to use application.run rather call ?

  2. #2
    Registered User
    Join Date
    12-27-2012
    Location
    Panama
    MS-Off Ver
    Excel 2007
    Posts
    90

    Re: opening a VBA file and runing its macro

    Found my answer,

    for those who need it,

    the document name goes in single quotes ' '

    the name and macro go in double quotes " "

    separate the macro name with an exclamation mark !

    Application.Run "'documentname'!macroname"

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1