Results 1 to 12 of 12

Thread: Automation Error

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Apr 2000
    Location
    Rafaela (Argentine)
    Posts
    107

    Automation Error

    Hi, in the following code, I get the error "Automation Error" when the execution reaches the line Set objInterface...

    Code:
    Private Sub Command1_Click()
        Dim objInterface As Object
        Dim objServer As Object
        
        On Error GoTo cuError
        
        Set objInterface = CreateObject("Intrf.Interface_Server")
        Set objServer = objInterface.objGetClassInstance("Class1")
        MsgBox objServer.showWindow
        
        Set objInterface = Nothing
        Set objServer = Nothing
        On Error GoTo 0
        Exit Sub
        
    cuError:
        MsgBox Err.Description
        Set objInterface = Nothing
        Set objServer = Nothing
        Exit Sub
    End Sub
    Object Intrf is installed on a server on the network. What are possible reasons for that error?

    Thanks in advance

  2. #2
    Fanatic Member ahara's Avatar
    Join Date
    Nov 2003
    Location
    Toronto
    Posts
    531
    can you provide the precise error message (with error code)?
    "Knowledge is gained when different people look at the same information in different ways"

    - Louis Pasteur

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Apr 2000
    Location
    Rafaela (Argentine)
    Posts
    107
    Err.Number -2147221231
    Err.Description Error de Automatización (spanish)
    Automation error (English)

    Thanks in advance!

  4. #4
    Fanatic Member ahara's Avatar
    Join Date
    Nov 2003
    Location
    Toronto
    Posts
    531
    Wish I could help you more but I am not an expert when it comes to the COM stuff....(still learning myself!)....I noticed that no one else replied and was kind of hoping some of our resident OO pros might jump in....all I know at this point is for some reason (and I hope this does not insult your intelligence - just trying to offer any kernel of info you might find useful) the object fails instantiation as the error is occuring at this time (Set statement). And becuase it is being accessed across a network, a likely assumption is that the call to it can't find it for some reason. Reasons may have to do with the GUID or the way it was registered perhaps....but again, I am swimming in murky waters in terms of my own experience. Sorry I could not be more helpful. Best of luck with it.
    "Knowledge is gained when different people look at the same information in different ways"

    - Louis Pasteur

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Apr 2000
    Location
    Rafaela (Argentine)
    Posts
    107
    Thanks for your answer ahara, it seems to be like you explain. But the problem is how to determine which is the problem, so I hope somebody could help with his own experience, or giving to me some alternatives to try in order to troubleshoot this problem.

    Could somebody please help me with this?

  6. #6
    Addicted Member JRSofty's Avatar
    Join Date
    Jan 2004
    Location
    Somewhere in Germany
    Posts
    149
    Are you testing this under the IDE or have you compiled it already?

    If you are doing this under the IDE then you need to open the server application (the one you called in the createObject function) under another instance of the VB IDE. Once you do this ensure that start mode for the server application is set to ActiveX Component and that in the debug tab that you have it set for "Wait until called" or something like this. Then run click the run program button and the app should just sit there. Now return to your client application (the one doing the calling) and attempt to run it once again.

    If you have already compiled the server application ensure that you have properly registered the application

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Apr 2000
    Location
    Rafaela (Argentine)
    Posts
    107
    I have it compiled, I'm not testing it under IDE. So, what do you mean by "ensure that you have properly registered the application"?

  8. #8
    Addicted Member JRSofty's Avatar
    Join Date
    Jan 2004
    Location
    Somewhere in Germany
    Posts
    149
    When you are dealing with ActiveX Components (dll or exe) you must register them with the operating system.

    From your run menu you need to enter:

    RegSrv32 and then the path where the file is located.

    I also just noticed that the server app is located on a remote computer so you will also need to generate a type library and register that on the client computer.

    I'm not real great on remote automation stuff so I'm going to leave it at that I'm sure someone with a little more exp can help you from this point on.

  9. #9

    Thread Starter
    Lively Member
    Join Date
    Apr 2000
    Location
    Rafaela (Argentine)
    Posts
    107
    Ok, thanks JRSofty for your collaboration. I feel we are getting closer to the solution.

    Server application is located in a remote computer, so I need some help on how to make my client application create the object in the server. Somebody please?

  10. #10
    Fanatic Member ahara's Avatar
    Join Date
    Nov 2003
    Location
    Toronto
    Posts
    531
    I'm with JMuller and would like to know the answer - if anyone out there has experience with COM....we need to know how to register a remote component on the network. How do we generate a type library that can be registered on the client computer? Thanks in advance.
    "Knowledge is gained when different people look at the same information in different ways"

    - Louis Pasteur

  11. #11

    Thread Starter
    Lively Member
    Join Date
    Apr 2000
    Location
    Rafaela (Argentine)
    Posts
    107
    Please... could anybody help me with this? Thanks!

  12. #12
    Fanatic Member Matt_T_hat's Avatar
    Join Date
    Dec 2001
    Location
    '76 Male Body Evil-Errors: 666
    Posts
    774

    Same error number different thread.

    There is no answer is the short answer.

    http://www.vbforums.com/showthread.p...16#post1763116

    Google has no idea: http://www.google.com/search?q=Error...&start=10&sa=N

    Experts exchange is silent: http://www.experts-exchange.com/Data..._21036797.html

    and all I know is that it effects some Access 2000 to 2003 crossover and MS-Exchange.

    It seems to be a wider MS-Issue but as to what I have no idea.
    ?
    'What's this bit for anyway?
    For Jono

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width