private void btnCellWrite_Click(object sender, EventArgs e)
{
string path = @"D:\MyWork\myself\CMC9\Grouting2008\Output\XOffice\OursNET.XOffice.XOffice2007.dll";
Assembly assm = Assembly.LoadFile(path);
IXExcel excel = (IXExcel)assm.CreateInstance("OursNET.XOffice2007.CXExcel");
excel.SetApplication(axFramerControl1.GetApplication);
excel.SetCellValue(1, 1, DateTime.Now.ToString());
excel.AddComment(1, 1, 1, 1, "我的热情");
int n = excel.FindCommentRow("我的");
excel.UniteCells(1, 1, 1, 2);
//OursNET.XOffice.CXExcel excel = new OursNET.XOffice.CXExcel();
//excel.SetApplication(axFramerControl1.GetApplication);
//excel.SetCellValue(1, 1, DateTime.Now.ToString());
//object o = excel.GetCellValue(2, 2);
}
/// <summary>
///
/// </summary>
public enum Constants
{
xlRTL = -5004,
xlLTR = -5003,
xlContext = -5002,
xlLatin = -5001,
xlBidi = -5000,
xlTop = -4160,
xlSimple = -4154,
xlRight = -4152,
xlOff = -4146,
xlNotes = -4144,
xlNone = -4142,
xlModule = -4141,
xlManual = -4135,
xlLow = -4134,
xlLeft = -4131,
xlJustify = -4130,
xlHigh = -4127,
xlGray75 = -4126,
xlGray50 = -4125,
xlGray25 = -4124,
xlFormats = -4122,
xlDistributed = -4117,
xlCustom = -4114,
xlCombination = -4111,
xlCenter = -4108,
xlBottom = -4107,
xlAutomatic = -4105,
xlAll = -4104,
xl3DSurface = -4103,
xl3DBar = -4099,
xlDefaultAutoFormat = -1,
xlFirst = 0,
xlAbove = 0,
xlLogicalCursor = 1,
xlClassic1 = 1,
xlLast = 1,
xlOn = 1,
xlBoth = 1,
xlIcons = 1,
xlShort = 1,
xlBelow = 1,
xlSolid = 1,
xlSquare = 1,
xlSystem = 1,
xlTiled = 1,
xlGeneral = 1,
xlToolbar = 1,
xlFullScript = 1,
xlTopToBottom = 1,
xlDirect = 1,
xlWorksheet4 = 1,
xlFixedValue = 1,
xlNarrow = 1,
xlExcelMenus = 1,
xlDoubleQuote = 1,
xlShowValue = 2,
xlOpen = 2,
xlPartialScript = 2,
xlVisualCursor = 2,
xlPercent = 2,
xlVeryHidden = 2,
xlPlusValues = 2,
xlTransparent = 2,
xlChart4 = 2,
xlDiamond = 2,
xlToolbarButton = 2,
xlSemiautomatic = 2,
xlStrict = 2,
xlLeftToRight = 2,
xlMixed = 2,
xlAdd = 2,
xlCorner = 2,
xlSingleQuote = 2,
xlGregorian = 2,
xlClassic2 = 2,
xlSingle = 2,
xlContents = 2,
xlLotusHelp = 2,
xlConstants = 2,
xlBar = 2,
xlInside = 2,
xlInteger = 2,
xlMaximum = 2,
xlColumn = 3,
xlNoDocuments = 3,
xlShowPercent = 3,
xlMinusValues = 3,
xlMixedScript = 3,
xlBidiCalendar = 3,
xlSubtract = 3,
xlScale = 3,
xlOpaque = 3,
xlTriangle = 3,
xlExtended = 3,
xlWide = 3,
xlPartial = 3,
xlOutside = 3,
xlWorksheetCell = 3,
xlLong = 3,
xlHindiNumerals = 3,
xlClosed = 3,
xlClassic3 = 3,
xlReference = 4,
xlShowLabel = 4,
xlComplete = 4,
xlMinimum = 4,
xlSingleAccounting = 4,
xlCross = 4,
xlMixedAuthorizedScript = 4,
xlStError = 4,
xlAccounting1 = 4,
xlMultiply = 4,
xlDoubleOpen = 4,
xlNextToAxis = 4,
xlWorksheetShort = 5,
xlShowLabelAndPercent = 5,
xlStar = 5,
xlDoubleClosed = 5,
xlAccounting2 = 5,
xlFormula = 5,
xlFloating = 5,
xlFill = 5,
xlDoubleAccounting = 5,
xlDivide = 5,
xlWorkbookTab = 6,
xlChartShort = 6,
xlAccounting3 = 6,
xlMacrosheetCell = 7,
xlCenterAcrossSelection = 7,
xlCascade = 7,
xlColor1 = 7,
xlAllExceptBorders = 7,
xlCircle = 8,
xlColor2 = 8,
xlTitleBar = 8,
xlColor3 = 9,
xlPlus = 9,
xlDesktop = 9,
xlChecker = 9,
xlList1 = 10,
xlSemiGray75 = 10,
xlLastCell = 11,
xlWatchPane = 11,
xlLightHorizontal = 11,
xlList2 = 11,
xlVisible = 12,
xlLightVertical = 12,
xlImmediatePane = 12,
xlList3 = 12,
xl3DEffects1 = 13,
xlLightDown = 13,
xlDebugCodePane = 13,
xl3DEffects2 = 14,
xlDrawingObject = 14,
xlLightUp = 14,
xlGrid = 15,
xlLocalFormat1 = 15,
xlLocalFormat2 = 16,
xlCrissCross = 16,
xlTextBox = 16,
xlGray16 = 17,
xlChartSeries = 17,
xlAccounting4 = 17,
xlGray8 = 18,
xlChartTitles = 18,
xlEntireChart = 20,
xlGridline = 22
}