I've been trying to write "early binding" code to control Excel with Automation. I've made considerable progress but can't figure out how to write a SAFEARRAY of numbers to Excel. Here is some simplified code:

CComPtr<_Application> m_pXLApp;
CComPtr<Workbooks> m_pWorkBooks;
CComPtr<_Workbook> pBook;
CComPtr<Sheets> m_pSheets;
CComPtr<_Worksheet> pSheet;
CComPtr<Range> pRange;
CComPtr<IDispatch> pDisp;
COleSafeArray saRet;  //holds the data
BSTR filename;

m_pXLApp.CoCreateInstance(L"Excel.Application", nullptr, CLSCTX_LOCAL_SERVER);
m_pWorkBooks->Open(filename, ...);
m_pWorkBooks->Add(vOptional, LOCALE_SYSTEM_DEFAULT, &pBook)
m_pSheets->get_Item(CComVariant(nXLWorksheetNo), &pDisp);
pSheet->get_Range(vVar1, vVar2, &pRange);
This simplified code looks good except there is no SetValue function for pRange. In fact, pRange is very limited in the number of functions available. How do you send an array of data to Excel using early binding?