ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Excel 2003 c++ automation problem. (https://www.excelbanter.com/excel-worksheet-functions/125263-excel-2003-c-automation-problem.html)

Ken

Excel 2003 c++ automation problem.
 

Excel 2003 c++ automation problem.



hello everyone

Im trying to do excel 2003 automation and I am using visual c++ 2005.

I inserted excel type library using class wizard and it generated
workbooks.h file for me but i got following problem.

In workbooks.h generated by class wizard, the following definitions returns
error saying "Parameter" is undefined. Is "Parameter" type defined somewhere
and do I have to import that definition from some where? Or do I need to
replace "Parameter" with something?

Also I am new to this and have no idea how to find information about how to
use these type library methods, like what each parameters are supposed to
mean. I looked up workbooks.add method in VBA help in excel2003 but its
explanation seems to be wrong (old?). it tells that add method has only one
parameter but the code below has 3 parameters.

How am I supposed to find information for excel 2003 methods and not older
excel library definitions? Also what is the general approach to learn how to
look up things and be able to figure stuff out yourself? where do i start,
etc.

//STDMETHOD(Add)(LPCTSTR Name, VARIANT& iDataType, Parameter * * RHS)
//{
// HRESULT result;
// static BYTE parms[] = VTS_BSTR VTS_VARIANT VTS_PDISPATCH ;
// InvokeHelper(0xb5, DISPATCH_METHOD, VT_HRESULT, (void*)&result, parms,
Name, &iDataType, RHS);
// return result;
//}

//STDMETHOD(Item)(VARIANT& Index, Parameter * * RHS)
//{
// HRESULT result;
// static BYTE parms[] = VTS_VARIANT VTS_PDISPATCH ;
// InvokeHelper(0xaa, DISPATCH_METHOD, VT_HRESULT, (void*)&result, parms,
&Index, RHS);
// return result;
//}


//Parameter get__Default(VARIANT& Index)
//{
// Parameter result;
// static BYTE parms[] = VTS_VARIANT ;
// InvokeHelper(0x0, DISPATCH_PROPERTYGET, VT_DISPATCH, (void*)&result,
parms, &Index);
// return result;
//}






All times are GMT +1. The time now is 10:02 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com