Solved

Ole automation and busy server

Posted on 2001-09-09
7
562 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
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VB6 Compile Compatibility Issue 4 116
using Access 8 76
Best way to parse out a json string in VB6? 10 228
which modules are active in VB6 project? 6 44
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…

820 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