ExcelApplication1->Workbooks->Open

Hey, I have problem in C++ builder 6.0. I don't know how to open ***.xlt(excel workbooks). Please help.

Error :

[C++ Error] Unit1.cpp(28): E2285 Could not find a match for 'Workbooks::Open(char *,OleVariant,OleVariant,OleVariant,OleVariant,OleVariant,OleVariant,
OleVariant,OleVariant,OleVariant,OleVariant,OleVariant,OleVariant,
OleVariant,OleVariant,int)

Code :

void __fastcall TForm1::Button1Click(TObject *Sender)
{


int a = 50;
ExcelApplication1->Connect();
ExcelApplication1->set_Visible(true, true);
ExcelApplication1->Workbooks->Open("C:g1.xlt", EmptyParam, EmptyParam, EmptyParam, EmptyParam,
EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam,
EmptyParam, EmptyParam, EmptyParam, 0);

ExcelWorkbook1->ConnectTo(ExcelApplication1->ActiveWorkbook);
ExcelWorksheet1->ConnectTo(ExcelApplication1->ActiveSheet);

ExcelWorksheet1->Cells->set_Item(Variant(1), Variant(1),Variant(WideString("Tekst")) );
ExcelWorksheet1->Cells->set_Item(Variant(2), Variant(1),Variant(WideString(a)) );


}


Thanks.[b][/b]
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories