Excel 2000 Automatisierungsproblem
-
Moin moin
ich versuche mit Hilfe der MFC eine Excel Datei zu öffnen. Ich habe gegoogelt und diese Support Seite gefunden.
Bei der AnweisungobjApp.CreateDispatch("Excel.Application"); objBooks = objApp.get_Workbooks();
jedoch bekomme ich einen Ausnahmefehler.
const COleDispatchDriver& COleDispatchDriver::operator=(const COleDispatchDriver& dispatchSrc) { if (this != &dispatchSrc) { LPDISPATCH lpTemp = m_lpDispatch; m_lpDispatch = dispatchSrc.m_lpDispatch; if (m_lpDispatch != NULL) m_lpDispatch->AddRef(); <------------ if (lpTemp != NULL && m_bAutoRelease) lpTemp->Release(); m_bAutoRelease = TRUE; } return *this; }
Der m_lpDispatch Zeiger von objApp hat einen Wert 0x000000000.
Ich weiss, das es eigentlich 100 % funktionieren sollte. Denn es hat einwandfrei geklappt bevor ich Visual Studio neu installiert hatte.Office 2000 habe ich auch schon neu installiert - ich weiss nicht weiter-
Nachtrag:
Nach dem Aufruf objApp.CreateDispatch("Excel.Application") hat die Variable m_lpDispatch einen Null Wert. Das dürfte doch nicht sein, oder ? Der müsste dann doch ungleich NULL sein.