Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
pass argument to macro
i have an application that wrote and i need to pass a string
representing an email address to my macro so it knows who to send to, can you pass an argument to a macro? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
pass argument to macro
Sure. Include what you want inside its parentheses:
Sub test() Call ") Call ") End Sub Sub emailer(ToWhom As String) MsgBox "mailing to " & ToWhom End Sub HTH. Best wishes Harald "tommy" skrev i melding ... i have an application that wrote and i need to pass a string representing an email address to my macro so it knows who to send to, can you pass an argument to a macro? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
pass argument to macro
but i'm calling the macro from a c# application so i need to send an
argument with my command to run the macro, my line that runs the macro is this RunMacro(excelApp, new Object[]{"'[excel file name]'!ActiveSheet.ActiveSheet"}); so i'm trying to figure how to send the argument from that line Harald Staff wrote: Sure. Include what you want inside its parentheses: Sub test() Call ") Call ") End Sub Sub emailer(ToWhom As String) MsgBox "mailing to " & ToWhom End Sub HTH. Best wishes Harald "tommy" skrev i melding ... i have an application that wrote and i need to pass a string representing an email address to my macro so it knows who to send to, can you pass an argument to a macro? |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
pass argument to macro
I don't think you can do that. Hopefully someone proves me wrong. Suggest
you try a C# newsgroup as well. Apart from that, I do anything to avoid having separate apps running separate pieces of code just to produce a single result. When I control Word from Excel then Excel has all the code, and vice verca. A ping-pong of macros would definitely cause trouble. So I suggest you try to do everything from C# while you're there. Best wishes Harald "Tommy" skrev i melding ... but i'm calling the macro from a c# application so i need to send an argument with my command to run the macro, my line that runs the macro is this RunMacro(excelApp, new Object[]{"'[excel file name]'!ActiveSheet.ActiveSheet"}); |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
pass argument to macro
http://support.microsoft.com/default...83&Product=xlw
HOW TO: Run Office Macros by Using Automation from Visual C# .NET see Case 1 in the sample code. It shows both with and without an argument. -- Regards, Tom Ogilvy "Harald Staff" wrote in message ... I don't think you can do that. Hopefully someone proves me wrong. Suggest you try a C# newsgroup as well. Apart from that, I do anything to avoid having separate apps running separate pieces of code just to produce a single result. When I control Word from Excel then Excel has all the code, and vice verca. A ping-pong of macros would definitely cause trouble. So I suggest you try to do everything from C# while you're there. Best wishes Harald "Tommy" skrev i melding ... but i'm calling the macro from a c# application so i need to send an argument with my command to run the macro, my line that runs the macro is this RunMacro(excelApp, new Object[]{"'[excel file name]'!ActiveSheet.ActiveSheet"}); |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I write a macro that will allow users to set thier own pass | Excel Worksheet Functions | |||
Path and Number of files in a folder. - Pass to Macro. | Excel Discussion (Misc queries) | |||
Get cell address from macro function argument | New Users to Excel | |||
Pass an argument to Excel workbook | Excel Programming | |||
How to pass an Excel range as an argument to a SQL Server stored Procedure | Excel Programming |