When Ctrl-C is pressed, XBrowse tries to load Excel, if not done earlier. This is done through a function ExcelObj() in the module \fwh\source\function\olefuncs.prg.
The code to load Excel or other office applciation in olefuncs.prg is this:
- Code: Select all Expand view
TRY
oObj := GetActiveObject( cApp )
CATCH
TRY
oObj := CreateObject( cApp )
CATCH
END
END
It has been reported by all users of xHarbour commerical and users of some versions of free xHarbour that their programs were hanging while executing "GetActiveObject( cApp )".
It was recommended to them to replace the above code with :
- Code: Select all Expand view
TRY
oObj := TOleAuto():New( cApp )
CATCH
END
This solution appeared to have solved their problems.
In some other cases of xHarbour users of some versions, when the excel object is loaded ( in either version of the above code ) the excel application was exiting with a Windows error code. I experienced this personally too.
Logically it is difficult to say why TOleAuto():New( cApp ) should give rise to such an error and that too only with some versions of xHarbour.
However changing all declarations of variables inside ExcelObj(), WordObj(), etc as "static" instead of "local" resolved the issue, though I can not explain this logically.
You may try tweaking with olefuncs.prg and help us with your feedback.
Latest build of 11.05 released on 6th June resolved this problem atleast in my case.