Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
run macro from onoter Excel session
Hi,
I am tring to run a macro from another open workbook on another excel session. I have tried using Application.Run (PathToFile & "\" & NameOfFile & "!MacroName") but the it open a new wotkbook (read only) and also get stuck. Any idea, Thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
run macro from onoter Excel session
Hello Dan,
We need to get the corresponding Application COM object of that Excel session and then call Application.Run() method. To get that Excel session's Application object, we can call the Marshal.BindToMoniker to get that workbook and then get the application from the Workbook.Application. http://msdn.microsoft.com/en-us/libr...services.marsh al.bindtomoniker.aspx http://www.xldennis.com/dloads/Acces...of%20Excel%20V B.txt (Process_Approach_BindToMoniker part) If you have any future questions or concerns, please let us know! Best regards, Ji Zhou Microsoft Community Online Support Team |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
run macro from onoter Excel session
I think the OP is working in Excel, not .NET
Tim "Colbert Zhou [MSFT]" wrote in message ... Hello Dan, We need to get the corresponding Application COM object of that Excel session and then call Application.Run() method. To get that Excel session's Application object, we can call the Marshal.BindToMoniker to get that workbook and then get the application from the Workbook.Application. http://msdn.microsoft.com/en-us/libr...services.marsh al.bindtomoniker.aspx http://www.xldennis.com/dloads/Acces...of%20Excel%20V B.txt (Process_Approach_BindToMoniker part) If you have any future questions or concerns, please let us know! Best regards, Ji Zhou Microsoft Community Online Support Team |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
run macro from onoter Excel session
Ok. Thanks Tim for the comments.
Dan, In Excel native VBA, we can get another Excel session's Workbook object by calling GetObject(pathname). Please refer to another post with the same title you post. Peter gives an example code there. If you need any future help on this, just let us know. Best regards, Ji Zhou Microsoft Online Community Support Team |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
mail a file with a macro, changing the user session | Excel Programming | |||
Macro to run RDP session | Excel Discussion (Misc queries) | |||
Startup and template locations in Citrix TS session and local session | Setting up and Configuration of Excel | |||
Start a new session when a session is already opend | Excel Programming | |||
Can't alt-tab between Excel workbooks in one session. Help! | Excel Discussion (Misc queries) |