Results 1 to 7 of 7

Thread: Automation error - Please Help :)

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2011
    Posts
    4

    Automation error - Please Help :)

    Dear all,

    I have created 2 excel workbooks to play the role of a Communication Log System in our school. Just put it on the server, activate sharing property, and u'll have a communication system much faster than emails, and more practical.

    The first file is where people insert there messages using a UserForm and is called "Log".

    The other one is called "Inbox". Using some excel functions, the Inbox file generates 3 lists:

    1- A To-Do list: a list of all messages that where sent to u.
    2- A Follow-Up list: a list of all messages that you sent.
    3- Announcements list: a list of all messages that where marked as general announcement.

    The 2 files are connected through VBA. The whole thing was supposed to be simple, and one interested in using it in his/her company, then u are more than welcome to download it using this link:

    http://www.evision-me.com/hariri/gli...cation_Log.rar

    There is one problem, the files worked fine for 1 time, then it started giving me this error:

    "Automation error The object invoked has disconnected from its clients"

    The problem is in the code, and the error message is appearing even before sharing the file.

    I'm really still a beginner at VBA and i couldn't understand the solutions that are posted in this forum or in other forums. Any help will be highly appreciated

    Regards
    Sadek

  2. #2
    Frenzied Member
    Join Date
    Jan 2010
    Location
    Connecticut
    Posts
    1,687

    Re: Automation error - Please Help :)

    Welcome to VB Forums!!!

    To fix the error you need to find the line in the code that is causing the error. Step through the code and check values to see if they are what you expect.
    VB6 Library

    If I helped you then please help me and rate my post!
    If you solved your problem, then please mark the post resolved

  3. #3

    Thread Starter
    New Member
    Join Date
    Mar 2011
    Posts
    4

    Re: Automation error - Please Help :)

    Dear MarMan

    I tried stepping in the code, i'm using a text boxes to insert a username and password, i called them:

    TextBoxUserName
    TextBoxPassword

    I placed a CommandButton and Called it:

    CBLogIn

    Once i press CBLogIn, the number in TextBoxUserName should go to cell E1 and number in TextBoxPassword should go to E2. It is supposed to be simple:

    Range("E1").Value = TextBoxUserName.Value
    Range("E2").Value = TextBoxPassword.Value

    Once the debuger reaches these lines, the program hangs.

    I tried selecting the cells first:

    Range("E1").Select
    ActiveCell.Value = TextBoxUserName.Value

    and through a variable:

    Dim UserName as Long
    UserName = TextBoxUserName.Value
    Range("E1").Value = UserName

    No matter what i try, every time i reach this command, i get:

    "Automation error The object invoked has disconnected from its clients"

    Any suggestions?!

    Thanks big time mate!!
    Regards
    Sadek

  4. #4

    Thread Starter
    New Member
    Join Date
    Mar 2011
    Posts
    4

    Re: Automation error - Please Help :)

    Nothing!!?

  5. #5
    Hyperactive Member
    Join Date
    Jun 2009
    Posts
    441

    Re: Automation error - Please Help :)

    Did you try to do something like

    VB Code:
    1. Sheets("yoursheetname").Range("E1").Value = UserName or Activesheet.Range("E1").Value = UserName
    ?

    I can't see in the above code the sheet object , try to declare the sheet or workbook object ...


    This may be coming from this ..

    Otherwise, Sometimes formulas can cause such errors, so try at the beginning of the macro to disactivate them then reactivate them ...

    For expl your macro is running to change the values while the execl is try automatically to recalculate them, so that it can cause the error you mentionned ...

    Try this :


    VB Code:
    1. Application.Calculation = xlCalculationManual
    2.  
    3. 'Your Code here
    4.  
    5. 'End of your Code
    6. Application.Calculation = xlCalculationAutomatic


    Also check this , it may help ?

  6. #6

    Thread Starter
    New Member
    Join Date
    Mar 2011
    Posts
    4

    Re: Automation error - Please Help :)

    justgreat you are the best... the automatic calculation was the problem, once I stopped it the file worked well...

    You are the best... I'll post back the files for everyone to check them and use them

    Regards
    Sadek

  7. #7
    Hyperactive Member
    Join Date
    Jun 2009
    Posts
    441

    Re: Automation error - Please Help :)

    Thanks Sadek, please Tag the Thread as Resolved once you post the file for others to check

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