I recorded a VBA macro in solidworks and I was wondering how do I run the macro from within my standalone c# program in visual studios?
you can use RunMacro2 method
2012 SOLIDWORKS API Help - RunMacro2 Method (ISldWorks)
As Ivana mentioned, ISldWorks::RunMacro2 is what you need. If you would like to see another example of this besides the one that is the API Help, please visit my Macro Library and download the files in "Run macro from another macro". (Requires a free membership at my web site.)
Sometimes it is unclear what arguments must be used with ISldWorks::RunMacro2. With my example you can open up both the calling macro and the called macro, and understand exactly where the arguments are coming from.
SolidWorks API Training & Services
Retrieving data ...