OLE problem, or what am I doing wrong? 
Author Message
 OLE problem, or what am I doing wrong?

Dag nab it, I meant to also post this to microsoft.office.developer.vba.

--
Please post your response to the newsgroup.


Quote:
> Read this only if you are a {*filter*}, or a {*filter*} who enjoys the pain of
> others.
> --------------------------------------------------------------------------
--
> -
> Over the past few daze, I've been writing a macro in FrontPage that uses
> Word
> VBA to do its thing. This particular task would actually be more
effectively
> done directly in Word VBA, but heck, I got tired of watching the election
> news on TV.

> Well, tonight, I seemed to get the macro working but then I started
getting
> the
> following message.
> ----
> Server Busy

> This action cannot be completed because the other program is busy. Choose
> 'Switch To' to activate the busy program and correct the problem.
> ---
> I searched MSDN and the MSFT KB and found two related articles.

> Q240809 explicitly refers to the same message but states that it applies
to
> Visual FoxPro, which I do not have. The article includes an example to
> reproduce the problem.

> Q138066 addresses handling OLE automation timeout and synchronization.

> Since I do not have FoxPro, I tried implementing the example given in
> Q240809 within the FrontPage macro. Alas, I could not since I do not know
> which
> library to reference to resolve OLERequestPendingTimeout.

> I said, OK, I'll show them!

> I wrote a VB 6 program (code given below) to emulate the example given in
> Q240809. The article used CreateObject, I didn't.

> In any case, even tho I set OLERequestPendingTimeout to 0, I still got the
> message. Guess what! Q240809 is contradicting the online help for
> OLERequestPendingTimeout. One has to increase the value to reduce the
chance
> of getting the message. MSFT needs to check out its examples.

> However, I still have not found a way to reference

OLERequestPendingTimeout

- Show quoted text -

Quote:
> in the FrontPage macro. I believe the same problem would occur in the
other
> Office apps since I do not know which library to reference.

> Anybody know how to do this in the Office apps?

> Attribute VB_Name = "modTestOLEREquestPendingTimeout"
> Option Explicit
> Sub main()
>     TestOLEREquestPending
> End Sub
> Sub TestOLEREquestPending()
>     Dim lngSaveOLETimeout As Long
>     Dim wdApp As Word.Application
>     lngSaveOLETimeout = App.OleRequestPendingTimeout
>     On Error Resume Next
>     'Get existing instance of Word
>     Set wdApp = GetObject(, "Word.Application")
>     If Err.Number <> 0 Then
>         ' Create new hidden instance of Word.
>         Set wdApp = New Word.Application
>         App.OleRequestPendingTimeout = 30000
>         Set wdApp = GetObject(, "Word.Application")
>     End If
>     On Error GoTo 0
>     With wdApp
>         .documents.Add
>         On Error Resume Next
>         .dialogs(88).Show
>         If Not .UserControl Then
>             .Quit savechanges:=wdDoNotSaveChanges
>         End If
>     End With
>     Set wdApp = Nothing
>     App.OleRequestPendingTimeout = lngSaveOLETimeout
> End Sub

> --
> Please post your response to the newsgroup.



Mon, 26 May 2003 15:48:52 GMT  
 OLE problem, or what am I doing wrong?
You can't. This is a VB executable specific command -- i.e., it sets the
the duration interval for VB's implementation of IMessageFilter.  Office
provides no such mechanism to override values for its message filter
implementation.

You could work around the issue by calling a VB ActiveX EXE that then does
the automation to Word. To prevent FP from blocking while the Automation
continued, you set the VB executable to run asynchronous (see the Coffee
example that ships with VB).  When the Automation is done, VB rasies an
event you could trap in FP, and you run the rest of your code.  If you
needed FP to be modal while waiting for the operation to finish, put up a
modal dialog and have the dialog wait for the VB event. The dialog could
display information to the user, but since it is running from VBA code (and
not an out-of-process COM call), if the user clicks on it he/she won't get
that OLE dialog.

Richard Taylor
Microsoft Developer Support



Sat, 31 May 2003 03:10:17 GMT  
 OLE problem, or what am I doing wrong?
Thanx.

I don't drink coffee, but I'll take a look at the example.
--
Please post your response to the newsgroup.


Quote:
> You can't. This is a VB executable specific command -- i.e., it sets the
> the duration interval for VB's implementation of IMessageFilter.  Office
> provides no such mechanism to override values for its message filter
> implementation.

> You could work around the issue by calling a VB ActiveX EXE that then does
> the automation to Word. To prevent FP from blocking while the Automation
> continued, you set the VB executable to run asynchronous (see the Coffee
> example that ships with VB).  When the Automation is done, VB rasies an
> event you could trap in FP, and you run the rest of your code.  If you
> needed FP to be modal while waiting for the operation to finish, put up a
> modal dialog and have the dialog wait for the VB event. The dialog could
> display information to the user, but since it is running from VBA code
(and
> not an out-of-process COM call), if the user clicks on it he/she won't get
> that OLE dialog.

> Richard Taylor
> Microsoft Developer Support



Sat, 31 May 2003 03:19:09 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. OLE problem, or what am I doing wrong?

2. Update Problem, What am I doing wrong?

3. Recordset: What am I doing wrong?

4. What am I doing wrong??

5. What am I doing wrong?

6. Help with syntax. What am I doing wrong

7. What am I doing wrong?

8. What am I doing wrong?

9. What am I doing wrong?

10. Please tell me what I am doing wrong - DAO parameter Append Query :(

11. What am I doing wrong? -MultiSelect List box

12. Select Case - What am I doing wrong?

 

 
Powered by phpBB® Forum Software