Werner Schmidt
2008-07-28 09:00:35 UTC
Hi all.
I'm using Borland C++ 6 and want to read the property of a Checkbox and an
OptionButton placed in a excel worksheet.
I use the Olefunctions to access excel and try to access the Checkbox with
vMSExcel.OleFunction("getByName","CheckBox1");
but the olefunction getByName is unknown.
Does anyone knows, how to access a Checkbox or OptionButton ?
Thanks
Here is the Code:
vMSExcel = Variant::CreateObject ( "Excel.Application" );
vMSExcel.OlePropertySet ( "Visible", (OleVariant) true );
vXLWorkbooks = vMSExcel.OlePropertyGet ( "Workbooks" );
vFileName = sFile.c_str (); // c:\myfolder\myfile.xls
vXLWorkbook = vXLWorkbooks.OleFunction ( "Open", (OleVariant)
vFileName );
vSheetName = "Tabelle1";
vWorksheet = vXLWorkbook.OlePropertyGet ( "Worksheets",
vSheetName );
vCheckbox = vMSExcel.OleFunction("getByName","CheckBox1"); // this
is not working!!
bool bChechbox;
bCheckbox = vCheckbox.OlePropertyGet("State",0);
I'm using Borland C++ 6 and want to read the property of a Checkbox and an
OptionButton placed in a excel worksheet.
I use the Olefunctions to access excel and try to access the Checkbox with
vMSExcel.OleFunction("getByName","CheckBox1");
but the olefunction getByName is unknown.
Does anyone knows, how to access a Checkbox or OptionButton ?
Thanks
Here is the Code:
vMSExcel = Variant::CreateObject ( "Excel.Application" );
vMSExcel.OlePropertySet ( "Visible", (OleVariant) true );
vXLWorkbooks = vMSExcel.OlePropertyGet ( "Workbooks" );
vFileName = sFile.c_str (); // c:\myfolder\myfile.xls
vXLWorkbook = vXLWorkbooks.OleFunction ( "Open", (OleVariant)
vFileName );
vSheetName = "Tabelle1";
vWorksheet = vXLWorkbook.OlePropertyGet ( "Worksheets",
vSheetName );
vCheckbox = vMSExcel.OleFunction("getByName","CheckBox1"); // this
is not working!!
bool bChechbox;
bCheckbox = vCheckbox.OlePropertyGet("State",0);