Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Does anyone have experience with sending an array of information to
Excel using OLE Automation and C++ ? I am looking for a way to speed up the sending of data from our app to Excel. Currently, we send data to Excel a cell at a time using the following code: void PutDoubleInTableHorizontal (int row, int column, int count, const double num []) { // put the doubles in horizontally for (int i = 0; i < count; i++) { if (uninitializedValue == num [i]) continue; std::string cellAddress = GetCellEquivalent (row, column + i); VARIANT result1; VariantInit ( & result1); VARIANT range; VariantInit ( & range); range.vt = VT_BSTR; _bstr_t address = _bstr_t (cellAddress.c_str ()); range.bstrVal = address; OLEMethod (DISPATCH_PROPERTYGET, & result1, pExcelSheet, L"Range", 1, range); if (result1.vt == VT_DISPATCH) { VARIANT result2; VariantInit ( & result2); VARIANT value; VariantInit ( & value); value.vt = VT_R8; value.dblVal = num [i]; OLEMethod (DISPATCH_PROPERTYPUT, & result2, result1.pdispVal, L"Value", 1, value); int res = result2.vt; result1.pdispVal - Release (); } } } I am wondering if sending an array of cells to Excel would be faster ? Sincerely, Lynn McGuire |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Sending An Email In Excel Programmatically W/O Sending An Object | Excel Programming | |||
Sending SMS from excel | Excel Programming | |||
sending excel | Excel Discussion (Misc queries) | |||
Sending array data to Word with DDEPoke | Excel Programming | |||
Sending an array to DLL Function | Excel Programming |