none
How to Get/Set Excel cell Fonts in C++ in OLE COM way RRS feed

  • Question

  • I'm trying to access Excel's Introp dll to create excel file in C++.

    All methods/properties of Font like Bold/Italic/Color/Size are accessible using InvokeHelper.

    Working Code:

    void Font::SetSize(const VARIANT& newValue)
    {
    	static BYTE parms[] =
    		VTS_VARIANT;
    	InvokeHelper(0x68, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms,
    		 &newValue);
    } 

    But when trying to invoke Font Name. It throws an error of Member not found.

    Not Working

    VARIANT Font::GetName()
    {
    	VARIANT result;
    	static BYTE parms[] =
    		VTS_VARIANT;
    	InvokeHelper(0x66, DISPATCH_PROPERTYGET, VT_VARIANT, (void*)&result, NULL);
    	return result;
    } 

    Any pointer will help.


    • Edited by upx8664 Wednesday, May 11, 2016 9:43 AM
    Wednesday, May 11, 2016 9:42 AM

All replies

  • Hi upx,

    I am not familiar with C++, and I'm trying to involve some senior engineers into this issue and it will take some time.

    Your patience will be greatly appreciated.

    Sorry for any inconvenience and have a nice day!

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Thursday, May 12, 2016 5:27 AM