The Variant ExcelApp;
The Variant VarSheet;
AnsiString fileName="XXX. XLT";
AnsiString STR=0;
Try
{
ExcelApp=: : CreateOleObject (" Excel. Application ");
}
The catch (const Exception & amp; E)
{
ShowMessage (" Microsoft Excel boot failure, please make sure whether it is right to install Microsoft Excel software! \ nErrorInfo: "+ AnsiString (e.c. with our fabrication: lassName ()) + E.M essage, 0).
return;
}
ExcelApp. PS (" Visible ", (Variant), true);
if(! FileExists (fileName))
{
VarSheet=Unassigned;
ExcelApp=Unassigned;
return;
}
Try
{
ExcelApp. PG (" workbooks "). The FN (" Open ", fileName. C_str ());
VarSheet=ExcelApp. OlePropertyGet (" ActiveWorkbook "). The OlePropertyGet (" Sheets ", 1);
}
The catch (... )
{
VarSheet=Unassigned;
ExcelApp=Unassigned;
return;
}
Out of the abnormal when creating the application the
Anomaly appeared on the part of the machine, has been reinstall office
Client machine operating system: Windows 7 Office version: 2010 pro
exception information:
EOleSysError does not support the interface Pray god to solve
CodePudding user response:
Such as ole profession of old demon lu had
CodePudding user response: