locked
How to run VS macro with multiple arguments RRS feed

  • Question

  • Is it possible to run a Visual Studio macro with multiple arguments from command window? According to the MSDN page it should be possible:

    http://msdn.microsoft.com/en-us/library/a0003t62%28v=vs.80%29.aspx

    At the end of the page there is a section about how to call such a macro. It says:

    Sub Test(Optional ByVal FirstArg As String = "", Optional ByVal SecondArg As String = "")
    MsgBox(FirstArg & vbCr & SecondArg)
    End Sub

    Could be called like this:

    >Macros.MyMacros.Module1.Test "Test Run Number: " 10

    However it doesn't work. Though it shows the messagebox with the expected message, in fact inside Test function FirstArg is "Test Run Number:" 10 and SecondArg is an empty string. Is it possible to specify these arguments in a parseable way?



    Tuesday, March 22, 2011 3:13 PM

Answers