Is there any alternative way of accessing excel macros by C#, not this method I mentioned

Jul 27 2005 3:41 PM

{
VBIDE.VBComponent module=
null;

module = wb.VBProject.VBComponents.Add(VBIDE.vbext_ComponentType.vbext_ct_StdModule);

module.CodeModule.AddFromString(GetMacro());

}

private static string GetMacro()

{

string retVal = "";

retVal+=("Sub FormatSheet()" + "\n");

retVal+=(" Range(\"A6:J13\").Select " + "\n");

retVal+=(" Selection.Font.ColorIndex = 3" + "\n");

retVal+=("End Sub");

return retVal;

}