Consultor Eletrônico



Kbase P102694: ActiveX: The RPC server is unavailable. Accessing EXCEL Workbooks:Open() Method.
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   3/31/2005
Status: Unverified

SYMPTOM(s):

Error occurred while accessing component property/method: Workbooks:Open().

The RPC server is unavailable.

Error code: 0x800706ba audit-log pro\bom-add.p (5890)

The error is occurring when opening anew workbook using this statement:
chWorkbook = chExcelAppl:Workbooks:Open(REPLACE(t-outpath,".csv",".xls")).

CAUSE:

The RPC server error generally occurs when an application is closed before it was done doing something. In this case, this error appears to be generated because of timing conflict between calculating the name of the file to be opened while invoking the Workbooks Object Open() method.

FIX:

To ensure that the Workbooks:Open() method is not invoked before the file name is fully constructed, separate the filename construction logic the method invocation by replacing the statement:
chWorkbook = chExcelAppl:Workbooks:Open(REPLACE(t-outpath,".csv",".xls")).
With:
DEFINE VARIABLE cFileName AS CHARACTER NO-UNDO.
cFilename = REPLACE(t-outpath,".csv",".xls").
chWorkbook = chExcelAppl:Workbooks:Open(REPLACE(cFilename).