For some years I have been running two ActiveX Excel spreadsheets in VBA simultaneously and have been able to run one spreadsheet as a kind of slave from the other using the "Application.Run" function eg. Application.Run "OtherWorkbook.xls!Sheet1.RunMacro" However just recently I have needed to convert the VBA macros to C#/.Net which I know very little about. Is there a function in C#/.Net whereby I can replicate the Application.Run function? In other words initiate a macro from another worksheet. Any help would be very much appreciated....
Hi, I am really sorry for not being clearer. Thank you for trying to understand. To be honest I am a trader not a programmer so I apologize for the ambiguity. I have two separate excel spreadsheets that run at the same time. They run continuously during market hours monitoring the markets. One is more of a "master" in that it runs the slave. These Spreadsheets have, up to now, used VBA but there is a necessity to change and run the spreadsheets via .Net. My question is how do you call a macro to start a run in another spreadsheet using .Net? In VBA I have used the Application.Run function and defined the other spreadsheet and the specific macro that I want to run. I am hoping to understand how to do this using .Net. If you could help I would be very grateful .... thank again in advance.
That article is how to reference cells from one worksheet to another. I am attempting (and so far failing) to call a macro to run in worksheet A from a master in worksheet B. If you could point me in the right direction I would be indebted.
Thanks Schizo for your help it is very much appreciated. I am trying find a way of calling the macro from within another worksheet using .net. I will persist and report back - thanks everyone.
Try this then. You're likely to be better served at Stackoverflow or other coding sites than here. https://stackoverflow.com/questions/35511731/running-an-excel-macro-on-a-different-workbook