Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 94
Default Interrupting initializing stage

I have a software that I am opening through Excel VBA, it inputs the
username, password and IP address and logs in to that software.

If I supply correct password, the macro works, it opens the software,
supplies username, password and IP and logs in

but if I supply incorrect password, it goes in an endless loop.

When I open the software physically (without the macro) and supply
incorrect password, it gives me a box <<INITIALIZING and does not
come out of it for a very long time, I have to end task it to get rid
of it.

My question, can we tell excel vba programatically before the the
initializing line starts that if initializing takes more than 60
seconds, then inturrupt that stage and go forward.

I tried on error resume next but it does not work as it does not gives
any error.

Any ideas???

Code:
Sub try()

    Dim App As Object
    Dim Conn As Object
    Dim Srv As Object

    Set App = CreateObject("MySoftware.Application")
    Set Conn = CreateObject("MyConnection..Connection")
    Set Srv = CreateObject(""MyServer.Server")

    If App.CreateServer("username", "", "", "my IP Address", False,
"ENU", Srv, Conn) Then
        If Conn.Login("username", "password", "my IP Address", "ENU")
Then 'This is the initializing line
            MsgBox "Logged in"
        Else
            MsgBox "Unable to login"
        End If
    End If

Set App = Nothing
Set Conn = Nothing
Set Srv = Nothing
    
End Sub
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Beta stage management - help MartinWann Links and Linking in Excel 0 March 22nd 10 05:57 PM
Projects and Stage Chart Marie Charts and Charting in Excel 1 June 17th 09 05:35 AM
TV-Scripts, Movie, Stage, and Novel Templates cjd Hiram OH Excel Discussion (Misc queries) 0 March 30th 08 08:11 PM
Interrupting a Loop Maxi[_2_] Excel Programming 5 January 25th 06 06:09 PM
Interrupting an add line Brian McGuire[_2_] Excel Programming 1 December 9th 03 07:39 PM


All times are GMT +1. The time now is 04:57 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"