Re:Excel TLB Problem
Hi all
I have done what all the people/manuals said and I am still not having much luck.
When I run the included code snippet I get the following error message
HRCHECK:
'this->Add(Template,lcid,(Excel_tlb::WorkbookPtr*)&RHS); Object is not connected to server
@Excel_TLB.h/18079.
Here is the code snippet:
#include <Excel_TLB.h>
TCOM_Application xlApp;Workbooks *wbs;Workbook *wb;
void __fastcall TForm1::Button1Click(TObject *Sender){ CoInitialize(NULL); xlApp = CoApplication_::Create(); xlApp.set_Visible(0,true); wbs = xlApp.get_Workbooks(); if ( wbs ) { wb = wbs->Add(); if ( wb ) { delete wb; } delete wbs; } xlApp.Quit();}
Can anybody please point me in the right direction.
Regards
Charles