Solved

Ole automation and busy server

Posted on 2001-09-09
7
565 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 
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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

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…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

734 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