Method AddCustomList of object _Application failed

YasserKhalil
PlatinumLounger
Posts: 4911
Joined: 31 Aug 2016, 09:02

Method AddCustomList of object _Application failed

Post by YasserKhalil »

Hello everyone
I have a code that was working well but suddenly I got an error at this line

Code: Select all

Application.AddCustomList x
and raises the error `Mehtod AddCutomList of object _Application failed`
Any idea how to fix that?

I tried this code but with no success

Code: Select all

Sub Demo()
    Dim i As Integer
    For i = Application.CustomListCount To 1 Step -1
        On Error Resume Next
        Application.DeleteCustomList (i)
        On Error GoTo 0
    Next i
End Sub

User avatar
HansV
Administrator
Posts: 78238
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Method AddCustomList of object _Application failed

Post by HansV »

Without knowing what x is and without knowing the context of that line, it is impossible to help.
Best wishes,
Hans

YasserKhalil
PlatinumLounger
Posts: 4911
Joined: 31 Aug 2016, 09:02

Re: Method AddCustomList of object _Application failed

Post by YasserKhalil »

The variable x is 1d array.

User avatar
HansV
Administrator
Posts: 78238
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Method AddCustomList of object _Application failed

Post by HansV »

Why don't you attach a sample workbook?
Best wishes,
Hans