• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ Excel函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中Excel函数的典型用法代码示例。如果您正苦于以下问题:C++ Excel函数的具体用法?C++ Excel怎么用?C++ Excel使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了Excel函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: xlAutoClose

DLLEXPORT int xlAutoClose() {

    static XLOPER xDll;

    try {

        // empty the ObjectHandler repository
        //Excel(xlUDF, 0, 1, TempStrNoSize("\x1c""ohRepositoryDeleteAllObjects"));

        // unregister the addin functions
        Excel(xlGetName, &xDll, 0);
        unregisterOhFunctions(xDll);
        Excel(xlFree, 0, 1, &xDll);

        return 1;

    } catch (const std::exception &e) {

        Excel(xlFree, 0, 1, &xDll);
        std::ostringstream err;
        err << "Error unloading ObjectHandler: " << e.what();
        Excel(xlcAlert, 0, 1, TempStrStl(err.str()));
        return 0;

    } catch (...) {

        Excel(xlFree, 0, 1, &xDll);
        return 0;

    }
}
开发者ID:AlexJiaeHwang,项目名称:quantlib,代码行数:31,代码来源:addin.cpp


示例2: xlAutoOpen

DLLEXPORT int xlAutoOpen() {

    static XLOPER xDll;

    try {

        Excel(xlGetName, &xDll, 0);

        ObjectHandler::Configuration::instance().init();
        registerOhFunctions(xDll);

        Excel(xlFree, 0, 1, &xDll);
        return 1;

    } catch (const std::exception &e) {

        std::ostringstream err;
        err << "Error loading ObjectHandler: " << e.what();
        Excel(xlcAlert, 0, 1, TempStrStl(err.str()));
        Excel(xlFree, 0, 1, &xDll);
        return 0;

    } catch (...) {

        Excel(xlFree, 0, 1, &xDll);
        return 0;

    }
}
开发者ID:AlexJiaeHwang,项目名称:quantlib,代码行数:29,代码来源:addin.cpp


示例3: xlAutoClose

DLLEXPORT int xlAutoClose() {

    static XLOPER xDll;

    try {

        Excel(xlGetName, &xDll, 0);

        unregisterOhFunctions(xDll);

        Excel(xlFree, 0, 1, &xDll);
        return 1;

    } catch (const std::exception &e) {

        std::ostringstream err;
        err << "Error unloading AddinXlHw: " << e.what();
        Excel(xlcAlert, 0, 1, TempStrStl(err.str()));
        Excel(xlFree, 0, 1, &xDll);
        return 0;

    } catch (...) {

        Excel(xlFree, 0, 1, &xDll);
        return 0;

    }

}
开发者ID:AAthresh,项目名称:quantlib,代码行数:29,代码来源:xl_hw.cpp


示例4: XLFUNC

/*
***************************************************************************
** Standard Excel function to provide the library name to Excel.
***************************************************************************
*/
XLFUNC(LPXLOPER) xlAddInManagerInfo(LPXLOPER xAction)
{
    static XLOPER xInfo, xIntAction;
    static char xLibName[JPMCDS_MAX_LIB_NAME];
    LPXLOPER pxInfo;

    /*
    ** This code coerces the passed-in value to an integer. This is how the
    ** code determines what is being requested. If it receives a 1, 
    ** it returns a string representing the long name. If it receives 
    ** anything else, it returns a #VALUE! error.
    */
    Excel(xlCoerce, &xIntAction, 2, xAction, TempInt(xltypeInt));

    if(xIntAction.val.w == 1)
    {
        xInfo.xltype = xltypeStr;
        xLibName[0] = strlen(gtoLibName);
        strncpy (xLibName+1, gtoLibName, xLibName[0]);
        xInfo.val.str = xLibName;
    }
    else
    {
        xInfo.xltype = xltypeErr;
        xInfo.val.err = xlerrValue;
    }

    Excel(xlFree, 0, 1, (LPXLOPER) &xIntAction ,0);    
    pxInfo = &xInfo;

    return pxInfo;
}
开发者ID:arthurpham,项目名称:CdsModel,代码行数:37,代码来源:xlfuncs.c


示例5: xlAutoClose

DLLEXPORT int xlAutoClose() {

    static XLOPER xDll;

    try {
        Excel(xlGetName, &xDll, 0);

#ifdef XLL_STATIC
        // Unregister ObjectHandler functions
        unregisterOhFunctions(xDll);
#endif

        // Unregister QuantLib functions
        unregisterSBSAFunctions(xDll);

        // Deallocate the Enumeration Registry
        QuantLibAddin::unregisterEnumerations();

        Excel(xlFree, 0, 1, &xDll);

        return 1;
    } catch (const std::exception &e) {
        std::ostringstream err;
        err << "Error unloading sbsa xll objects: " << e.what();
        Excel(xlcAlert, 0, 1, TempStrStl(err.str()));
        Excel(xlFree, 0, 1, &xDll);
        return 0;
    } catch (...) {
        Excel(xlFree, 0, 1, &xDll);
        return 0;
    }
}
开发者ID:daveysj,项目名称:sbsa,代码行数:32,代码来源:addin_SBSA.cpp


示例6: registerPrices

void registerPrices(const XLOPER &xDll) {

        Excel(xlfRegister, 0, 15, &xDll,
            // function code name
            TempStrNoSize("\x0F""qlMidEquivalent"),
            // parameter codes
            TempStrNoSize("\x07""EPPPPP#"),
            // function display name
            TempStrNoSize("\x0F""qlMidEquivalent"),
            // comma-delimited list of parameter names
            TempStrNoSize("\x1A""Bid,Ask,Last,Close,Trigger"),
            // function type (0 = hidden, 1 = worksheet)
            TempStrNoSize("\x01""1"),
            // function category
            TempStrNoSize("\x14""QuantLib - Financial"),
            // shortcut text (command macros only)
            TempStrNoSize("\x00"""),
            // path to help file
            TempStrNoSize("\x00"""),
            // function description
            TempStrNoSize("\x47""returns the mid price if available, or a suitable substitute otherwise."),
            // parameter descriptions
            TempStrNoSize("\x1D""bid price. Default value = 0."),
            TempStrNoSize("\x1D""ask price. Default value = 0."),
            TempStrNoSize("\x1E""last price. Default value = 0."),
            TempStrNoSize("\x1F""close price. Default value = 0."),
            TempStrNoSize("\x1D""dependency tracking trigger  "));

        Excel(xlfRegister, 0, 13, &xDll,
            // function code name
            TempStrNoSize("\x09""qlMidSafe"),
            // parameter codes
            TempStrNoSize("\x05""EPPP#"),
            // function display name
            TempStrNoSize("\x09""qlMidSafe"),
            // comma-delimited list of parameter names
            TempStrNoSize("\x0F""Bid,Ask,Trigger"),
            // function type (0 = hidden, 1 = worksheet)
            TempStrNoSize("\x01""1"),
            // function category
            TempStrNoSize("\x14""QuantLib - Financial"),
            // shortcut text (command macros only)
            TempStrNoSize("\x00"""),
            // path to help file
            TempStrNoSize("\x00"""),
            // function description
            TempStrNoSize("\x3D""returns the mid price only if both bid and ask are available."),
            // parameter descriptions
            TempStrNoSize("\x1D""bid price. Default value = 0."),
            TempStrNoSize("\x1D""ask price. Default value = 0."),
            TempStrNoSize("\x1D""dependency tracking trigger  "));



}
开发者ID:mlbrock,项目名称:TmpRepo_QL,代码行数:55,代码来源:register_prices.cpp


示例7: Excel

XLL_DEC XLOPER *ohRangeRetrieveError(XLOPER *xRange) {
    try {
        XLOPER xTemp;
        Excel(xlCoerce, &xTemp, 1, xRange);
        static XLOPER xRet;
        if (xTemp.xltype & xltypeErr)
            Excel(xlUDF, &xRet, 2, TempStrNoSize("\x13""ohRetrieveErrorImpl"), xRange);
        else
            ObjectHandler::scalarToOper(std::string(), xRet);
        return &xRet;
    } catch (...) {
        return 0;
    }
}
开发者ID:derekcameron,项目名称:quantlibcl,代码行数:14,代码来源:manual.cpp


示例8: Excel

    bool CallingRange::valid() const {
        if (callerType_ == CallerType::Cell) {
            Xloper xDef, xRef;
            
            Excel(xlfGetName, &xDef, 1, TempStrStl(key_));

            std::string address = ConvertOper(xDef());
            Excel(xlfTextref, &xRef, 1, TempStrStl(address.substr(1)));

            bool ret = (xRef->xltype & (xltypeRef | xltypeSRef)) != 0;
            return ret;
        } else {
            return true;
        }
    }
开发者ID:AAthresh,项目名称:quantlib,代码行数:15,代码来源:callingrange.cpp


示例9: unregisterxlInstrumentYield

inline void unregisterxlInstrumentYield(const XLOPER & xDll) {

        XLOPER xlRegID ;

             // Libère la fonction xlInstrumentTheoreticalYield
        Excel(xlfRegister, 0, 15, & xDll,
            TempStrNoSize("\x11""xlInstrumentYield"),
            TempStrNoSize("\x07""PCEPCP#"),
            TempStrNoSize("\x13""INSTRUMENT.TAUX.NEW"),
            TempStrNoSize("\x49""Identifiant de l'instrument,prix,date de règlement,convention,déclencheur"),
            TempStrNoSize("\x01""1"),
            TempStrNoSize("\x15""xlObjectTools - Bond"),
            TempStrNoSize("\x00"""),
            TempStrNoSize("\x00"""),
            TempStrNoSize("\x56""Cette fonction calcule le taux de l'instument selectionné selon la convention désignée"),
            TempStrNoSize("\x18""L'instrument à valoriser"),
            TempStrNoSize("\x17""Le prix de l'instrument"),
            TempStrNoSize("\x14""La date de règlement"),
            TempStrNoSize("\x28""L'identifiant de la convention de calcul"),
            TempStrNoSize("\x1C""Le déclencheur du recalcul  ")) ;

        Excel4(xlfRegisterId, & xlRegID, 2, & xDll,
            TempStrNoSize("\x11""xlInstrumentYield")) ;

        Excel4(xlfUnregister, 0, 1, & xlRegID) ;

    }
开发者ID:vermosen,项目名称:xlObjectTools,代码行数:27,代码来源:register_xlInstrumentYield.hpp


示例10: unregisterxlInitiateFixedLegUnitedStates

inline void unregisterxlInitiateFixedLegUnitedStates(const XLOPER & xDll) {

    XLOPER xlRegID ;

    // Enregistre la fonction xlInitiateFixedLeg
    Excel(xlfRegister, 0, 20, & xDll,
          TempStrNoSize("\x1E""xlInitiateFixedLegUnitedStates"),
          TempStrNoSize("\x0C""PCEPPEPEPPP#"),
          TempStrNoSize("\x21""INSTANCE.JAMBE.FIXE.UNITED.STATES"),
          TempStrNoSize("\xA1""Identifiant de l'instrument,date effective,date de premier coupon,date de dernier coupon,date de maturité,notionel,taux de coupon,fréquence,base annuelle,trigger"),
          TempStrNoSize("\x01""1"),
          TempStrNoSize("\x17""xlObjectTools - Object"),
          TempStrNoSize("\x00"""),
          TempStrNoSize("\x00"""),
          TempStrNoSize("\x3A""Cette fonction instancie une jambe fixe de swap en dollar."),
          TempStrNoSize("\x19""L'identifiant de la jambe"),
          TempStrNoSize("\x2B""La date de début de cumul du premier coupon"),
          TempStrNoSize("\x19""La date du premier coupon"),
          TempStrNoSize("\x19""La date de dernier coupon"),
          TempStrNoSize("\x1F""La date de maturité de la jambe"),
          TempStrNoSize("\x16""Le notionel du contrat"),
          TempStrNoSize("\x11""Le taux de coupon"),
          TempStrNoSize("\x16""La fréquence de coupon"),
          TempStrNoSize("\x1C""La base annuelle de la jambe"),
          TempStrNoSize("\x17""Déclenche le recalcul  ")) ;

    Excel4(xlfRegisterId, & xlRegID, 2, & xDll,
           TempStrNoSize("\x1E""xlInitiateFixedLegUnitedStates")) ;

    Excel4(xlfUnregister, 0, 1, & xlRegID) ;

}
开发者ID:vermosen,项目名称:xlObjectTools,代码行数:32,代码来源:register_xlInitiateFixedLegUnitedStates.hpp


示例11: unregisterxlInitiateTreasuryNote

inline void unregisterxlInitiateTreasuryNote (const XLOPER & xDll) {

        XLOPER xlRegID ;

             // Enregistre la fonction xlInitiateMatrix
        Excel(xlfRegister, 0, 18, & xDll,
            TempStrNoSize("\x16""xlInitiateTreasuryNote"),
            TempStrNoSize("\x0A""PCEEEEEEP#"),
            TempStrNoSize("\x0F""INSTANCE.TNOTE"),
            TempStrNoSize("\x83""identifiant de l'instrument,date d'emission,date effective,premier coupon,penultième coupon,date de maturité,taux de coupon,trigger"),
            TempStrNoSize("\x01""1"),
            TempStrNoSize("\x17""xlObjectTools - Object"),
            TempStrNoSize("\x00"""),
            TempStrNoSize("\x00"""),
            TempStrNoSize("\x34""Cette fonction instancie une obligation du trésor US"),
            TempStrNoSize("\x1D""L'identifiant de l'instrument"),
            TempStrNoSize("\x1B""La date d'émission du titre"),
            TempStrNoSize("\x2B""La date de début de cumul de premier coupon"),
            TempStrNoSize("\x25""La date de paiement du premier coupon"),
            TempStrNoSize("\x1C""La date du penultième coupon"),
            TempStrNoSize("\x1C""La date de maturité du titre"),
            TempStrNoSize("\x21""Le taux de coupon de l'obligation"),
            TempStrNoSize("\x17""Déclenche le recalcul  ")) ;

        Excel4(xlfRegisterId, & xlRegID, 2, & xDll,
            TempStrNoSize("\x0F""xlInitiateTNote")) ;

        Excel4(xlfUnregister, 0, 1, & xlRegID) ;

    }
开发者ID:vermosen,项目名称:xlObjectTools,代码行数:30,代码来源:register_xlInitiateTreasuryNote.hpp


示例12: unregisterxlInstrumentRollDown

inline void unregisterxlInstrumentRollDown(const XLOPER & xDll) {

    XLOPER xlRegID ;

    Excel(xlfRegister, 0, 16, & xDll,
          TempStrNoSize("\x14""xlInstrumentRollDown"),
          TempStrNoSize("\x08""PCCEPPP#"),
          TempStrNoSize("\x14""INSTRUMENT.ROLL.DOWN"),
          TempStrNoSize("\x6E""Identifiant de l'instrument,identifiant de la courbe,date de fin,spread initial,convention de taux,déclencheur"),
          TempStrNoSize("\x01""1"),
          TempStrNoSize("\x15""xlObjectTools - Bond"),
          TempStrNoSize("\x00"""),
          TempStrNoSize("\x00"""),
          TempStrNoSize("\x79""Cette fonction calcule le prix à terme d'un instrument pour un spread et une courbe spot et à un horizon de portage donné"),
          TempStrNoSize("\x1D""L'identifiant de l'instrument"),
          TempStrNoSize("\x1A""L'identifiant de la courbe"),
          TempStrNoSize("\x19""La date de fin de portage"),
          TempStrNoSize("\x2B""Le spread de l'instrument en points de base"),
          TempStrNoSize("\x27""L'identifiant de la convention employée"),
          TempStrNoSize("\x1C""Le déclencheur du recalcul  ")) ;

    Excel4(xlfRegisterId, & xlRegID, 2, & xDll,
           TempStrNoSize("\x14""xlInstrumentRollDown")) ;

    Excel4(xlfUnregister, 0, 1, & xlRegID) ;

}
开发者ID:vermosen,项目名称:xlObjectTools,代码行数:27,代码来源:register_xlInstrumentRollDown.hpp


示例13: unregisterxlInstrumentPrice

inline void unregisterxlInstrumentPrice(const XLOPER & xDll) {

    XLOPER xlRegID ;

    // release the function registerxlInstrumentPrice
	Excel(	xlfRegister, 0, 15, &xDll,
			TempStrNoSize("\x11""xlInstrumentPrice"),
			TempStrNoSize("\x07""PCPEPP#"),
			TempStrNoSize("\x0A""BOND.PRICE"),
			TempStrNoSize("\x33""identifier,settlement date,yield,convention,trigger"),
			TempStrNoSize("\x01""1"),
			TempStrNoSize("\x15""xlObjectTools - Bond"),
			TempStrNoSize("\x00"""),
			TempStrNoSize("\x00"""),
			TempStrNoSize("\x4D""This function computes the bond price from its yield for the given convention"),
			TempStrNoSize("\x15""Instrument identifier"),
			TempStrNoSize("\x25""instrument settlement date (optional)"),
			TempStrNoSize("\x10""instrument yield"),
			TempStrNoSize("\x24""rate convention identifer (optional)"),
			TempStrNoSize("\x25""Triggers the computation (optional)  "));

    Excel4(xlfRegisterId, & xlRegID, 2, & xDll,
            TempStrNoSize("\x11""xlInstrumentPrice")) ;

    Excel4(xlfUnregister, 0, 1, & xlRegID) ;

}
开发者ID:vermosen,项目名称:xlObjectTools,代码行数:27,代码来源:register_xlInstrumentPrice.hpp


示例14: unregisterxlInitiateOvernightIndexedBootstrapHelper

inline void unregisterxlInitiateOvernightIndexedBootstrapHelper(const XLOPER & xDll) {

    XLOPER xlRegID ;

	// unregister the xlInitiateDepositBootstrapHelper function
	Excel(xlfRegister, 0, 15, &xDll,
		TempStrNoSize("\x29""xlInitiateOvernightIndexedBootstrapHelper"),
		TempStrNoSize("\x07""PCCEEP#"),
		TempStrNoSize("\x22""OBJECT.CURVE.HELPER.OVERNIGHT.SWAP"),
		TempStrNoSize("\x39""object indentifier,index identifier,maturity,rate,trigger"),
		TempStrNoSize("\x01""1"),
		TempStrNoSize("\x16""xlObjectTools - Object"),
		TempStrNoSize("\x00"""),
		TempStrNoSize("\x00"""),
		TempStrNoSize("\x40""This function creates an OIS swap helper for curve bootstrapping"),
		TempStrNoSize("\x11""Object Identifier"),
		TempStrNoSize("\x11""Index indentifier"),
		TempStrNoSize("\x19""Maturity date of the swap"),
		TempStrNoSize("\x16""Fixed rate of the swap"),
		TempStrNoSize("\x19""Trigger for recalculation"));

    Excel4(xlfRegisterId, & xlRegID, 2, & xDll,
        TempStrNoSize("\x29""xlInitiateOvernightIndexedBootstrapHelper")) ;

    Excel4(xlfUnregister, 0, 1, & xlRegID) ;

}
开发者ID:vermosen,项目名称:xlObjectTools,代码行数:27,代码来源:register_xlInitiateOvernightIndexedBootstrapHelper.hpp


示例15: unregisterxlInitiateCurveShift

inline void unregisterxlInitiateCurveShift(const XLOPER & xDll) {

    XLOPER xlRegID ;

    // Enregistre la fonction xlInitiateCurveShift
    Excel(xlfRegister, 0, 15, & xDll,
          TempStrNoSize("\x14""xlInitiateCurveShift"),
          TempStrNoSize("\x07""PCPPCP#"),
          TempStrNoSize("\x0E""INSTANCE.SHIFT"),
          TempStrNoSize("\x4D""identifiant de l'objet,vecteur des gaps,vecteur des shifts,convention,trigger"),
          TempStrNoSize("\x01""1"),
          TempStrNoSize("\x1C""xlObjectTools - Object"),
          TempStrNoSize("\x00"""),
          TempStrNoSize("\x00"""),
          TempStrNoSize("\x2B""Cette fonction instancie un shift de courbe"),
          TempStrNoSize("\x16""L'identifiant du shift"),
          TempStrNoSize("\x1E""Les maturités exprimés en gaps"),
          TempStrNoSize("\x1B""Les valeurs de perturbation"),
          TempStrNoSize("\x1E""La convention de taux employée"),
          TempStrNoSize("\x17""Déclenche le recalcul  ")) ;

    Excel4(xlfRegisterId, & xlRegID, 2, & xDll,
           TempStrNoSize("\x26""xlInitiateCurveShift")) ;

    Excel4(xlfUnregister, 0, 1, & xlRegID) ;

}
开发者ID:vermosen,项目名称:xlObjectTools,代码行数:27,代码来源:register_xlInitiateCurveShift.hpp


示例16: unregisterxlInitiateSwaptionHelper

inline void unregisterxlInitiateSwaptionHelper(const XLOPER & xDll) {

        XLOPER xlRegID ;

		// unregister the function xlInitiateSwaptionHelper
		Excel(xlfRegister, 0, 22, &xDll,
			TempStrNoSize("\x18""xlInitiateSwaptionHelper"),
			TempStrNoSize("\x0F""PCEEECCCCCPPPP#"),
			TempStrNoSize("\x29""OBJECT.VOLATILITY.SURFACE.SWAPTION.HELPER"),
			TempStrNoSize("\x8F""identifier,exercice,maturity,volatility,index,fixed leg tenor,fixed leg daycounter,float leg daycounter,curve,error type,strike,nominal,trigger"),
			TempStrNoSize("\x01""1"),
			TempStrNoSize("\x16""xlObjectTools - Object"),
			TempStrNoSize("\x00"""),
			TempStrNoSize("\x00"""),
			TempStrNoSize("\x57""This function instanciates a swaption helper for volatility surface calibration purpose"),
			TempStrNoSize("\x1A""The name of the instrument"),
			TempStrNoSize("\x11""The exercice date"),
			TempStrNoSize("\x0C""The end date"),
			TempStrNoSize("\x15""The quoted volatility"),
			TempStrNoSize("\x10""The fixing index"),
			TempStrNoSize("\x13""The fixed leg tenor"),
			TempStrNoSize("\x18""The fixed leg daycounter"),
			TempStrNoSize("\x1B""The floating leg daycounter"),
			TempStrNoSize("\x0F""The yield curve"),
			TempStrNoSize("\x3D""The calibration Error type (defaults to relative price error)"),
			TempStrNoSize("\x1A""The strike rate (optional)"),
			TempStrNoSize("\x16""The nominal (optional)"));

        Excel4(xlfRegisterId, & xlRegID, 2, & xDll,
            TempStrNoSize("\x1D""xlInitiateSwaptionHelper")) ;

        Excel4(xlfUnregister, 0, 1, & xlRegID) ;

    }
开发者ID:vermosen,项目名称:xlObjectTools,代码行数:34,代码来源:register_xlInitiateSwaptionHelper.hpp


示例17: unregisterxlInitiateTimeSeries

inline void unregisterxlInitiateTimeSeries(const XLOPER & xDll) {

        XLOPER xlRegID ;

		// freed the function xlInitiateTimeSeries
		Excel(xlfRegister, 0, 14, &xDll,
			TempStrNoSize("\x14""xlInitiateTimeSeries"),
			TempStrNoSize("\x06""CCPPP#"),
			TempStrNoSize("\x12""OBJECT.TIME.SERIES"),
			TempStrNoSize("\x27""object indentifier,dates,values,trigger"),
			TempStrNoSize("\x01""1"),
			TempStrNoSize("\x16""xlObjectTools - Object"),
			TempStrNoSize("\x00"""),
			TempStrNoSize("\x00"""),
			TempStrNoSize("\x2A""This function creates a time series object"),
			TempStrNoSize("\x11""Object Identifier"),
			TempStrNoSize("\x09""The dates"),
			TempStrNoSize("\x16""The corresponding data"),
			TempStrNoSize("\x1C""Trigger for recalculation   "));

        Excel4(xlfRegisterId, & xlRegID, 2, & xDll,
            TempStrNoSize("\x10""xlInitiateTimeSeries")) ;

        Excel4(xlfUnregister, 0, 1, & xlRegID) ;

    }
开发者ID:vermosen,项目名称:xlObjectTools,代码行数:26,代码来源:register_xlInitiateTimeSeries.hpp


示例18: Excel

XLL_DEC XLOPER *ohRangeRetrieveError(XLOPER *xRange) {
    try {
        reposit::Xloper xTemp;
        Excel(xlCoerce, &xTemp, 1, xRange);
        static XLOPER xRet;
        if (xTemp->xltype & xltypeErr) {
            Excel(xlUDF, &xRet, 2, TempStrNoSize("\x13""ohRetrieveErrorImpl"), xRange);
            xRet.xltype |= xlbitXLFree;
        } else {
            reposit::scalarToOper(std::string(), xRet);
        }
        return &xRet;
    } catch (...) {
        return 0;
    }
}
开发者ID:ChinaQuants,项目名称:quantlib-old,代码行数:16,代码来源:manual.cpp


示例19: unregisterContractsForwardAsian

void unregisterContractsForwardAsian(const XLOPER &xDll) 
{
    XLOPER xlRegID;
    // Unregister each function.  Due to a bug in Excel's C API this is a
    // two-step process.  Thanks to Laurent Longre for discovering the
    // workaround implemented here.

        Excel(xlfRegister, 0, 18, &xDll,
            TempStrNoSize("\x1A""createContractForwardAsian"),
            TempStrNoSize("\xA""CCPPPBBCL#"),
            TempStrNoSize("\x1A""createContractForwardAsian"),
            TempStrNoSize("\x3D""ObjectID,AveStart,AveEnd,SettDate,Strike,Volume,B/S,Permanent"),
            TempStrNoSize("\x01""1"),                   // function type (0 = hidden function, 1 = worksheet function, 2 = command macro)
            TempStrNoSize("\x9""prObjects"),            // function category            
            TempStrNoSize("\x00"""),                    // shortcut text (command macros only)            
            TempStrNoSize("\x00"""),                    // path to help file
            TempStrNoSize("\x26""Constructs an Oil Average Rate Forward"),
            TempStrNoSize("\x1A""id of object to be created"),  // parameter descriptions
            TempStrNoSize("\x19""Start of averaging period"),
            TempStrNoSize("\x17""End of averaging period"),
            TempStrNoSize("\xF""Settlement date"),
            TempStrNoSize("\x6""Strike"),
            TempStrNoSize("\x6""Volume"),
            TempStrNoSize("\x1D""Buy or Sell at the fixed rate"),
            TempStrNoSize("\x1D""object permanent/nonpermanent"));

        Excel4(xlfRegisterId, &xlRegID, 2, &xDll,
            TempStrNoSize("\x1A""createContractForwardAsian"));
        Excel4(xlfUnregister, 0, 1, &xlRegID);
}
开发者ID:daveysj,项目名称:sjd,代码行数:30,代码来源:Register_ContractForwardAsian.cpp


示例20: unregisterxlCurveForwardRate

inline void unregisterxlCurveForwardRate(const XLOPER & xDll) {

        XLOPER xlRegID ;

		// Unregister the function xlCurveForwardRate
		Excel(xlfRegister, 0, 15, &xDll,
			TempStrNoSize("\x12""xlCurveForwardRate"),
			TempStrNoSize("\x07""BCEECP#"),
			TempStrNoSize("\x12""CURVE.FORWARD.RATE"),
			TempStrNoSize("\x31""curve identifier,time 1,time 2,convention,trigger"),
			TempStrNoSize("\x01""1"),
			TempStrNoSize("\x1B""xlObjectTools - Yield Curve"),
			TempStrNoSize("\x00"""),
			TempStrNoSize("\x00"""),
			TempStrNoSize("\x43""This function computes the forward rate for the corresponding dates"),
			TempStrNoSize("\x10""Curve identifier"),
			TempStrNoSize("\x10""The forward date"),
			TempStrNoSize("\x11""The maturity date"),
			TempStrNoSize("\x20""The identifier of the convention"),
			TempStrNoSize("\x1B""Trigger for recalculation  "));

        Excel4(xlfRegisterId, & xlRegID, 2, & xDll,
            TempStrNoSize("\x12""xlCurveForwardRate")) ;

        Excel4(xlfUnregister, 0, 1, & xlRegID) ;

    }
开发者ID:vermosen,项目名称:xlObjectTools,代码行数:27,代码来源:register_xlCurveForwardRate.hpp



注:本文中的Excel函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ Except函数代码示例发布时间:2022-05-30
下一篇:
C++ Excecao函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap