PDA

View Full Version : Call was rejected by callee



ldoodle
07-20-2010, 03:53 AM
Hiya,

We have a 3rd party app that relies on VBA for pulling data from a SQL database into templates. These in themselves seem to work OK but with a few hiccups on the way.

The VBA projects have Application.Activate commands in and these are the first failures with error 'Cannot activate application'. I have remarked this out in one of the templates and I now get Call was rejected by callee error messages.

What is done in Office 2010 that isn't in 2007 or 2003 as these VBA projects all work OK in these versions.

Thanks

ldoodle
07-21-2010, 02:10 AM
Just a quick update. These problems do not exist if I load Word 2010 before running the 3rd party app.

So it appears Word 2010 is doing something 'differently' in it's startup procedure.

gmaxey
07-21-2010, 04:31 AM
Maybe you could start Word in the VB project using something like this:


Dim oApp As Object
Dim bAppStart As Boolean
On Error Resume Next
Set oApp = GetObject(, "Word.Application")
If Err Then
bAppStart = True
Set oApp = CreateObject("Word.Application")
End If
'The existing code up to the Application.Activate command
oApp.Activate
'The existing code after the Applicaiton.Activate command
If bAppStart = True Then oApp.Quit

fumei
07-21-2010, 09:15 AM
Yes, we need to see exactly how things are being called. The fact that things appear to be differnt if Word is already running is significant, but in what way precisely can only be guessed at without seeing your actual code.