{
VBIDE.VBComponent module=
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;}
Replies
Know the answer? Post it — somebody with the same question will find it here.