登 录
private void ThisWorkbook_Startup(object sender, System.EventArgs e) { string sCode = "Sub VBAMacro()/r/n" + "MsgBox /"Test/"/r/n" + "End Sub"; VBComponent oModule; oModule = Globals.ThisWorkbook.VBProject.VBComponents.Add(vbext_ComponentType.vbext_ct_StdModule); oModule.CodeModule.AddFromString(sCode); }
抱歉!评论已关闭.