Solved

Ole automation and busy server

Posted on 2001-09-09
7
561 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
NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

 
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

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…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

773 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