Home > Back-end >  BCB call failed to Excel/high marks for help
BCB call failed to Excel/high marks for help

Time:10-19

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:

reference 1st floor sololie response:
such as ole profession of old demon lu had

Gratitude: professional quality

CodePudding user response:

Which version of the BCB?

CodePudding user response:

ExcelApp=: : CreateOleObject (" Excel. Application ");
Change
Bcb6, 2007
ExcelApp=the Variant: : CreateObject (" excel. Application ");
After 2010 and
ExcelApp=the Variant: : CreateObject (L "excel. Application");

CodePudding user response:

This problem is not so good processing, compare the error and error system, what's the difference between software installed?

CodePudding user response:

Have encountered is that users don't turn it off a few days, then appeared the fault, after the reboot,

CodePudding user response:

CodePudding user response:

The
reference 4 floor bigfog reply:
ExcelApp=: : CreateOleObject (" Excel. Application ");
Change
Bcb6, 2007
ExcelApp=the Variant: : CreateObject (" excel. Application ");
After 2010 and
ExcelApp=the Variant: : CreateObject (L "excel. Application");


On my machine is 2010, also can be!

CodePudding user response:

CreateOleObject parameter is an AnsiString object (low) or UnicodeString objects (high), the parameters of the plug in, whether it be a char *, or would be *, are automatically converted to the corresponding data types, that is to say:
Use Excel. Application and L "Excel. Application" is no different,

In order to assure the success of creating Office objects, try to install the native Office programs,

CodePudding user response:

references 9 f ccrun response:
CreateOleObject parameter is an AnsiString object (low) or UnicodeString object (high), the parameters of the plug in, whether it be a char *, or would be *, are automatically converted to the corresponding data types, that is to say:
Use Excel. Application and L "Excel. Application" is no different,

In order to assure the success of creating Office objects, try to install the native Office programs,


Demon elder brother: office I have installed the latest version of the program!
Use reports controls: Report the Machine can generate Excel file,
Initial guess will because the system is through the ghost installation, cause the file missing?
If so, I'm going to replace the dynamic link library directly, just don't know the dynamic link library will replace what?
Replaced at present: system32/ole32. DLL will not be able to solve this problem,

Demon elder brother, you big fairy action!

CodePudding user response:

Ghost system, this is not sure, replace ole32. DLL may not have any effect,

CodePudding user response:

11 references ccrun response:
Ghost system, this is not sure, replace ole32. DLL may not have any effect,


Don't ask customer reinstall system?
No controls handled with statements, but don't know how to deal with two statements control data set,

CodePudding user response:

I also encountered this problem, but I was office2010 can normal, office2003 is wrong, is using the function the vExcelApp=the Variant: : CreateObject (" Excel. Application ");

CodePudding user response:

May I ask you how to make the office2003 also export to normal?
  • Related