Results 1 to 4 of 4

Passing arguments to a macro in another file

Threaded View

  1. #1
    Registered User
    Join Date
    06-05-2009
    Location
    Mumbai, India
    MS-Off Ver
    Excel 2003
    Posts
    5

    Passing arguments to a macro in another file

    Hi,

    I use the following macro "modifystri" in a workbook "Modify" to pass a variable to a macro ("macro1") located in a sheet ("Sheet1") in another workbook ("Test.xls")

    sub modifystri ()
    dim stri as string
    Call Application.run "Test.xls!Sheet1.macro1", stri
    end sub

    The definition of macro1 located in workbook "Test.xls" is:

    sub macro1 (stri as string)
          stri = "ABC"
    end sub
    The value of stri after calling "macro1" is still empty. I want to use "macro1" to modify the contents of stri. Please help.
    Last edited by abhimanyut; 06-05-2009 at 05:43 AM. Reason: Put code tags around code snippet

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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