Solved

Ole automation and busy server

Posted on 2001-09-09
7
559 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
Comment Utility
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
Comment Utility
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
Comment Utility
Thanks ameba, that would indeed mean that there is no other way of doing this than brute force or with user intervention?
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 15

Accepted Solution

by:
ameba earned 50 total points
Comment Utility
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
Comment Utility
all right thanks for the confirmation
0
 
LVL 15

Expert Comment

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

Expert Comment

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

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
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…

743 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

11 Experts available now in Live!

Get 1:1 Help Now