Thanks in advance.
jheske
"JillH" <jhe...@mindspring.com> wrote in message
news:3e5fb60e$1...@newsgroups.borland.com...
If you have the Office and Excel installed , you can get some help in
C:\Program Files\Microsoft Office\Office\1046\VBAXL9.CHM for office 2000
or VBAXL10.CHM for office XP
There you can find the object of Excel , it is very similar to
TExcelApplication , but you have to make some agreement
// --------START
Excel_2k::RangePtr Cell;
// Configuring your Control
ExcelApplication1->AutoConnect=false;
ExcelApplication1->ConnectKind =ckNewInstance;
ExcelWorkbook1->AutoConnect=false;
ExcelWorkbook1->ConnectKind =ckAttachToInterface;
ExcelWorksheet1->AutoConnect=false;
ExcelWorksheet1->ConnectKind =ckAttachToInterface;
// Open Excel
ExcelApplication1->Workbooks->Open(StringToOleStr("C:\\Workbook1.xls"));
// Must put Full Path
ExcelApplication1->set_Visible(LOCALE_SYSTEM_DEFAULT,true);
// ----------- Putting values
Cell=ExcelApplication1->Cells->get_Range_((TVariant)"A1", (TVariant)"A1");
Cell->set_Value(TVariant("Application.Cells"));
ExcelWorksheet1->ConnectTo(ExcelApplication1->Worksheets->get_Item((TVariant
)1));
Cell=ExcelWorksheet1->get_Range((TVariant)"A4", (TVariant)"A4"); //
Cell->set_Value(TVariant("Application.Workseet.Range"));
ExcelWorkbook1->ConnectTo(ExcelApplication1->Workbooks->get_Item(TVariant(1)
));
ExcelWorksheet1->ConnectTo(ExcelWorkbook1->Sheets->get_Item((TVariant)1));
Cell=ExcelWorksheet1->get_Range((TVariant)"A3", (TVariant)"A3"); //
Cell->set_Value(TVariant("Workbooks.Workseet.Range"));
Cell=ExcelWorksheet1->get_Range((TVariant)"C1", (TVariant)"F5"); //
Cell->set_Value(TVariant("123"));
// ------------ Geting one Value
Cell=ExcelWorksheet1->get_Range((TVariant)"A1", (TVariant)"A1"); //
Edit3->Text=OleVariant(Cell->get_Value());
// ------------ Getting Range of Values
Cell=ExcelWorksheet1->get_Range((TVariant)"A1", (TVariant)"B2"); //
OleVariant mv;
mv=OleVariant(Cell->get_Value());
if(mv.IsArray()){ // confirma se e array
Edit1->Text=mv.ArrayDimCount();
Memo1->Lines->Append(mv.GetElement(1,1));
Memo1->Lines->Append(mv.GetElement(1,2));
Memo1->Lines->Append(mv.GetElement(2,1));
Memo1->Lines->Append(mv.GetElement(2,2));
}
// Close and Save your Work
// ExcelWorkbook1->Close((TVariant)true);
// Closing the Excel
// ExcelApplication1->Quit();
// --------END
Roberto
"JillH" <jhe...@mindspring.com> escreveu na mensagem
news:3e5fb60e$1...@newsgroups.borland.com...
I copied the code below into my compiler and it seems to compile fine but I
get a "Class not registered" error when the thing starts running. Any idea
which objects I need to register, and how?
Thanks
Ilan
"Roberto" <ca...@charao.com.br> wrote in message
news:3e664519$1...@newsgroups.borland.com...
"Alex Bakaev [TeamB]" <zx...@att.net> wrote in message
news:3e77...@newsgroups.borland.com...
.a
"Alex Bakaev [TeamB]" <zx...@att.net> wrote in message
news:3e78...@newsgroups.borland.com...
some like "Microsoft Excel 9.0 Object Library" , this list show all the
Type Library
registed in your system, but if you are work normaly with Excel Is because
it is regited
, in the [ADD] button you may register the C:\Program files\Microsoft
office\office\EXECEL9.OLB
with is the COM where is the class TExcelApplication and other usend in
CBuilder
I beleave , you some lost some other Type Library , or have
corrupted *.cpp e *.h
used by CBuilder to acesses EXCEL.exe
roberto
"Ilan Azbel" <il...@mdio.net> escreveu na mensagem
news:3e77...@newsgroups.borland.com...
Would an idiot be able to reinstall a product?
.a
"Alex Bakaev [TeamB]" <zx...@att.net> wrote in message
news:3e7a19ec$1...@newsgroups.borland.com...
Well, than a non-idiot should be able to trace into the call, see where
exactly the exception happens, figure out what GUID was used, and then
figure out what is that's not registered. I'm not sure I can ask of you
to do that though.
.a
"Alex Bakaev [TeamB]" <zx...@att.net> wrote in message
news:3e80fb73$1...@newsgroups.borland.com...