Solved

Ole automation and busy server

Posted on 2001-09-09
7
560 Views
Last Modified: 2009-12-16
Hi experts, we've got a nice problem at this question and i'm out of ideas

http://www.experts-exchange.com/jsp/qShow.jsp?qid=20180244

:O)Bruintje

PS. if you solve it there i will add some points on this link too
0
Comment
Question by:bruintje
  • 5
  • 2
7 Comments
 
LVL 15

Expert Comment

by:ameba
ID: 6468465
If Excel is waiting for some user input, you can handle that - what you mentioned is the way to go.

The default handling is to wait some time and then show Server Busy Dialog.

You can show your own MsgBox and tell the user to switch to Excel.
Or you don't show any dialog, you just do a Beep:

From PAQ (10 pts): http://www.experts-exchange.com/jsp/qShow.jsp?ta=visualbasic&qid=20116886

' code to set focus to a cell
' it will Beep, instead of showing 'busy dialog'
'
Private Sub Command1_Click()

    Dim savtim As Long
    savtim = App.OleServerBusyTimeout
    Debug.Print "timeout=" & savtim
   
    ' temporary change the way your app handles OleServerBusy errors
    App.OleServerBusyTimeout = 200
    App.OleServerBusyRaiseError = True
    On Error GoTo eh
   
    objSheet.Cells(1, 1).Select ' error, if some excel dialog is opened
   
    AppActivate "Microsoft Excel"

ciao:
    App.OleServerBusyRaiseError = False
    App.OleServerBusyTimeout = savtim
    Exit Sub
   
eh:
    Beep
    Debug.Print "cannot select cell, error: " & Err.Description
    Resume ciao
End Sub
0
 
LVL 15

Expert Comment

by:ameba
ID: 6468473
If someone thinks that that pending dialog can be automatically resolved - well, we normally do NOT do that, e.g. send Cancel - there are too many possible and unknown dialogs to handle that properly.
0
 
LVL 44

Author Comment

by:bruintje
ID: 6468497
Thanks ameba, that would indeed mean that there is no other way of doing this than brute force or with user intervention?
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 15

Accepted Solution

by:
ameba earned 50 total points
ID: 6468509
Yes, user must check the message.
I don't know if you work(ed) with Win95, or with 20MB files with many pictures - I have seen messages when file is in 'danger'...
0
 
LVL 44

Author Comment

by:bruintje
ID: 6468515
all right thanks for the confirmation
0
 
LVL 15

Expert Comment

by:ameba
ID: 6468518
DISCLAIMER:
If you use brute force, I am not responsible for any damage.  ;-)
0
 
LVL 15

Expert Comment

by:ameba
ID: 6468523
Thanks, I think you deserve the points. I was just confirming...
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now