Excel don’t save on closing

oWB.BeforeSave += new Microsoft.Office.Interop.Excel.WorkbookEvents_BeforeSaveEventHandler(oWB_BeforeSave);

 

void oWB_BeforeSave(bool SaveAsUI, ref bool Cancel){

//SaveAsUI = false;

Cancel = true;

throw new Exception(“The method or operation is not implemented”);

}

Anuncios

String format

string value1 = “Dot Net Perls”;

int value2 = 10000;

DateTime value3 = new DateTime(2007, 11, 1);

string result = string.Format(“{0}:{1:0.0}-{2:yyyy}”, value1, value2, value3);

//Output: DotNetPerls: 10000.0-2007