I've been trying to modify the code to open a new instance of Excel
and create a worksheet use for embedding but can't get it to work.
Basicly it is as follows:
Excel::_ApplicationPtr excelApp;
hr = excelApp.CreateInstance("Excel.Application");
if(SUCCEEDED(hr))
try{
Excel::WorkbooksPtr workBooks= excelApp->GetWorkbooks();
Excel::_WorkbookPtr book = workBooks->Add();
Excel::SheetsPtr sheets= book->GetWorksheets();
IDispatchPtr sheet = sheets->Add();
hr = sheet.QueryInterface(IID_IOleObject,ppole);
}catch(.........
The last call to QI returns E_NOINTERFACE.
I must be missing something or misunderstanding the Excel Object
model.
Is there a way to get the IOleObject I need to allow this to be
embedded from a specific instance of Excel?
TIA
Otis
--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: agnic...@mvps.org
MVP VC FAQ: http://vcfaq.mvps.org
=====================================
"OBQuiet" <obri...@my-dejanews.com> wrote in message
news:4141900c-0301-4ea0...@b1g2000hsg.googlegroups.com...