Consulting

Results 1 to 16 of 16

Thread: RunTimeerror 2147417848 (80010108) Object invoked disconnected from its clients

  1. #1
    VBAX Regular
    Joined
    Dec 2012
    Posts
    55
    Location

    RunTimeerror 2147417848 (80010108) Object invoked disconnected from its clients

    Hi
    I'm stuck with this run time error.
    "Run-Time Error -2147417848 (80010108)
    Automation Error
    The object invoked has disconnected from its clients."

    Below is the code is used in a seperate module and called the same using a Option Button taken from Form Tool.

    [vba]Sub BusDiv_CFG()
    'Sheets("Input_Sheet").Unprotect "O1"
    Rows("23:150").EntireRow.Hidden = False
    Range("D19,D42,D52,D63,D74,D84,D94,D104,D114,D124,D134").Select
    With Selection.Validation
    .Delete
    .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:=xlBetween, Formula1:="=BusDiv_CFG"
    .IgnoreBlank = True
    .InCellDropdown = True
    .ShowInput = True
    .ShowError = True
    End With
    If Range("D9").Value = "" Or Range("D9").Value = "ORBIT User Access Removal (stop user access to ORBIT)" Then

    Rows("21:22").EntireRow.Hidden = False
    Rows("24:150").EntireRow.Hidden = True
    ElseIf Range("D9").Value = "CLONE Existing ORBIT User" Then

    Rows("21:22").EntireRow.Hidden = True
    Rows("24:35").EntireRow.Hidden = False
    Rows("34:150").EntireRow.Hidden = True

    ElseIf Range("D9").Value = "New ORBIT User Request (user does not have access to ORBIT)" Or Range("D9").Value = "ORBIT User Update Request (existing ORBIT user requiring modification)" Or Range("D9").Value = "Other (any other misc user request)" Then

    Rows("21:22").EntireRow.Hidden = True
    Rows("24:35").EntireRow.Hidden = True
    Rows("34:150").EntireRow.Hidden = False
    ActiveSheet.Outline.ShowLevels RowLevels:=1
    End If
    'Sheets("Input_Sheet").Protect "O1"
    End Sub[/vba]


    When executed in break mode i'm getting the error in the below line:

    [vba].Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:=xlBetween, Formula1:="=BusDiv_CFG"[/vba]

  2. #2
    VBAX Regular
    Joined
    Dec 2012
    Posts
    55
    Location
    Note:

    The "=BusDiv_CFG" refers an Offset Named range.

  3. #3
    VBAX Regular
    Joined
    Dec 2012
    Posts
    55
    Location
    Hi Excelions

    Any help on the above is much appreciated....

    Completely....Lost....

  4. #4
    VBAX Tutor mohanvijay's Avatar
    Joined
    Aug 2010
    Location
    MADURAI
    Posts
    268
    Location
    Please post workbook

  5. #5
    VBAX Regular
    Joined
    Dec 2012
    Posts
    55
    Location
    Hii Mohan

    Pls find attached the sample file.

    thks
    Attached Files Attached Files
    Last edited by Rem0ram; 02-14-2013 at 02:03 AM. Reason: CORRECT FILE

  6. #6
    VBAX Tutor mohanvijay's Avatar
    Joined
    Aug 2010
    Location
    MADURAI
    Posts
    268
    Location
    In attached workbook there is no range named "BusDiv_CFG"

    the "Input_Sheet" has protected so i could not work with that

  7. #7
    VBAX Tutor mohanvijay's Avatar
    Joined
    Aug 2010
    Location
    MADURAI
    Posts
    268
    Location
    Sorry i thought "O1" as zero and 1 now i correct it

    Try like below this works for me

    [vba]

    Range("D19,D42,D52,D63,D74,D84,D94,D104,D114,D124,D134").Select
    With Selection.Validation
    'change above code like this

    With Range("D19,D42,D52,D63,D74,D84,D94,D104,D114,D124,D134").Validation

    [/vba]

  8. #8
    VBAX Regular
    Joined
    Dec 2012
    Posts
    55
    Location
    Many Thanks!

    But now i'm getting "Method 'Add' of Object validation failed"

    Is this something the module contains more than 64k of data?

  9. #9
    VBAX Regular
    Joined
    Dec 2012
    Posts
    55
    Location
    The above error occors in the BusDiv_CFG() only

  10. #10
    VBAX Tutor mohanvijay's Avatar
    Joined
    Aug 2010
    Location
    MADURAI
    Posts
    268
    Location
    i tried in excel 2007 it works fine

    i think 64k is not a problem

    Check the code again.

    did you uncomment the following line?

    'Sheets("Input_Sheet").Unprotect "O1"

  11. #11
    VBAX Regular
    Joined
    Dec 2012
    Posts
    55
    Location
    Apologies!

    Fixed it...now it works....

    Thanks a Trillion.....! you rocked.......

  12. #12
    VBAX Tutor mohanvijay's Avatar
    Joined
    Aug 2010
    Location
    MADURAI
    Posts
    268
    Location
    instead of using lot of procedures you can done by this single procedure by passing range name parameter like below

    [vba]
    'create main procedure like below

    Sub My_List(Rng_Name As String)
    Sheets("Input_Sheet").Unprotect "O1"
    Rows("21:150").EntireRow.Hidden = False

    With Range("D19,D42,D52,D63,D74,D84,D94,D104,D114,D124,D134").Validation
    .Delete
    .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:=xlBetween, Formula1:=Rng_Name

    End Sub

    'Create single line procedure for call above procedure

    Sub BusDiv_BS()

    My_List "=BusDiv_BS"

    End sub

    Sub BusDiv_CFG()

    My_List "=BusDiv_CFG"

    End sub
    [/vba]

  13. #13
    VBAX Regular
    Joined
    Dec 2012
    Posts
    55
    Location
    Thanks!

    Yes, you are right...i'm still pretty much young to vba....i will now start the code optimization....

    Once Again Thanks a lot....

  14. #14
    Knowledge Base Approver VBAX Wizard
    Joined
    Apr 2012
    Posts
    5,646
    You better modify the existing validation instead of deleting validation first an add new ones.

    [vba]
    Range("D19,D42,D52,D63,D74,D84,D94,D104,D114,D124,D134").Validation.modify xlValidateList, xlValidAlertStop, xlBetween, Rng_Name
    [/vba]

  15. #15
    VBAX Regular
    Joined
    Dec 2012
    Posts
    55
    Location
    Thks Snb....will try....

  16. #16
    VBAX Regular
    Joined
    Dec 2012
    Posts
    55
    Location
    HI

    while using the above code...its working fine but when ever i hit a radio button the hidding & unhidding of rows is visible while triggering a macro...

    Is there a way to fix this?

    I tried using screen update =false and true at begining and end but still no use.....

Posting Permissions

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